Change email templates in Alfresco

I am trying to edit an task-editemail link that is sent to the assignees of a task. I see this in the file wf-emails.html.ftl, but in the Data Dictionary -> Email Templates -> Workflow Notificationinside of the Alfresco admin account. How can I edit this file through the Alfresco module (all-in-one, for example, in an amplifier) ​​...

I put

modular-context.xml

  <bean id="customSpacesBootstrap" parent="spacesStoreImporter" singleton="true" >
        <property name="useExistingStore">
            <value>true</value>
        </property>
        <property name="bootstrapViews">
            <list>
                <props>
                    <prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.email.childname}</prop>
                    <prop key="location">alfresco/module/repo-amp/bootstrap/config_email_templates.xml</prop>
                </props>
            </list>
        </property>
    </bean>

config_email_templates.xml

<view:view xmlns:view="http://www.alfresco.org/view/repository/1.0"
           xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0"
           xmlns:emailserver="http://www.alfresco.org/model/emailserver/1.0">

    <cm:folder view:childName="cm:My First Folder">
        <app:uifacets />
        <cm:name>My First Folder</cm:name>
        <app:icon>space-icon-default</app:icon>
        <cm:title>My First Folder</cm:title>
        <cm:description></cm:description>
        <cm:contains>
            <cm:content view:childName="cm:custom_email_template.ftl">
                <view:aspects>
                    <cm:titled />
                    <cm:author />
                    <app:inlineeditable />
                </view:aspects>
                <view:properties>
                    <app:editInline>true</app:editInline>
                    <cm:description>This is a custom email template.</cm:description>
                    <cm:content>contentUrl=classpath:alfresco/module/repo-amp/bootstrap/custom_email_template.ftl|mimetype=text/plain|size=|encoding=UTF-8|locale=en_US_</cm:content>
                    <cm:title>My first email template</cm:title>
                    <cm:author>Me</cm:author>
                    <cm:name>custom_email_template.ftl</cm:name>
                </view:properties>
                <view:associations></view:associations>
            </cm:content>
        </cm:contains>
    </cm:folder>
</view:view>

And in

custom_email_templates.ftl

I placed the template with the changes. But the email is not editable.

How can i do this?

+4
source share
2 answers

From Alfresco Documentation :

XML // UUID.

node, :

<bean id="myModule.bootstrap" class="org.alfresco.repo.module.ImporterModuleComponent"  parent="module.baseComponent">
    <property name="uuidBinding">
        <value>REPLACE_EXISTING</value>
    </property>

...

, uuid , :

<view:properties>
    <sys:node-uuid>b7c6b88a-e5fd-4ccf-b134-69a2460c3b89</sys:node-uuid>
....
+1

: Alfresco Login Reset Repo AMP https://github.com/teqnology/alfresco-login-reset-repo

, . , : alfresco-email-template-bootstrap.acp

, service-context.xml, , acp ( ). ' . .

, maven:

  • acp ( Alfrecso Explorer ftl): src/main/amp/config/alfresco/bootstrap/emailtemplate.acp
  • service-context.xml, acp : src/main/amp/config/alfresco/module/<yourmoduleid>/context/service-context.xml

JS API Alfresco, :

  var mailTemplates = search.xpathSearch("/app:company_home/app:dictionary/app:email_templates/cm:custom-email-template/cm:youremailtemplate.ftl");
 if(mailTemplates.length > 0){
   mail.parameters.template = mailTemplates[0];
 }else{
    mail.parameters.text = "Rollback to plain text if template is not found";
 }
0

All Articles