AnsweredAssumed Answered

Scheduled script, mail sending and i18n

Question asked by jrott on Oct 17, 2011

I created a scheduled script following this post :

My bean defeinition :
   <!– Run a job daily at 8.30 to send out an email about expiring agreements –>
    <bean id="scheduledExpringAgreements" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
        <property name="jobDataAsMap">
                <entry key="scriptLocation">
                    <bean class="org.alfresco.repo.jscript.ClasspathScriptLocation">
                <entry key="scriptService">
                    <ref bean="ScriptService"/>
                <entry key="authenticationComponent">
                   <ref bean="authenticationComponent"/>
    <bean id="scheduledExpiringAgreementsTrigger" class="org.alfresco.util.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="scheduledExpringAgreements" />
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        <property name="cronExpression">
            <value>0 30 8 * * ?</value>

The script is scheduled and running fine. It creates a mail and calls a template, following this post
var result = nodeUtil.processClasspathTemplate("alfresco/templates/email/MyTemplate.ftl", args, myNode);

Everything works fine, but I'd like to go a bit further and localize the mail.
So, is there a way to import in the scheduled script or in the ftl template i18n properties ?