Alfresco 中的电子邮件模板更改
Email template changes in Alfresco
我正在尝试编辑发送给任务受让人的电子邮件 task-edit
的 link。我在文件 wf-emails.html.ftl
中看到了这一点,但在 Alfresco 管理员帐户内的 Data Dictionary -> Email Templates -> Workflow Notification
中看到了这一点。我如何通过 Alfresco 的模块(例如,一体机,在放大器中)编辑此文件...
我输入了
module-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>
并且在
custom_email_templates.ftl
我对模板进行了编辑。
但是电子邮件没有编辑。
我该怎么做?
这里:
Alfresco Login Reset Repo AMP
https://github.com/teqnology/alfresco-login-reset-repo
您将找到有关如何添加自定义电子邮件模板的源代码示例。
更具体地说,电子邮件模板位于名为:
alfresco-email-template-bootstrap.acp
最后,这里是文件 service-context.xml,其中包含有关如何导入此类 bootstrap 自定义 acp 文件(其中包含自定义电子邮件模板)的信息。
'
希望这可以帮助。
干杯。
长话短说,您应该在 Maven 项目中进行此设置:
- 您的电子邮件模板打包为 acp(您可以使用旧的 Alfrecso Explorer 界面导出您的 ftl 模板):
src/main/amp/config/alfresco/bootstrap/emailtemplate.acp
- 您的
service-context.xml
文件在此处声明 bootstrap 导入上述 acp 文件:src/main/amp/config/alfresco/module/<yourmoduleid>/context/service-context.xml
从那里您可以通过 Alfresco JS 免费使用它 API,例如:
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";
}
XML imports can only replace/update/delete files that have their UUID set.
如果您想替换现有节点,您将需要更多地了解 import strategy :
<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>
....
我正在尝试编辑发送给任务受让人的电子邮件 task-edit
的 link。我在文件 wf-emails.html.ftl
中看到了这一点,但在 Alfresco 管理员帐户内的 Data Dictionary -> Email Templates -> Workflow Notification
中看到了这一点。我如何通过 Alfresco 的模块(例如,一体机,在放大器中)编辑此文件...
我输入了
module-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>
并且在
custom_email_templates.ftl
我对模板进行了编辑。 但是电子邮件没有编辑。
我该怎么做?
这里: Alfresco Login Reset Repo AMP https://github.com/teqnology/alfresco-login-reset-repo
您将找到有关如何添加自定义电子邮件模板的源代码示例。 更具体地说,电子邮件模板位于名为: alfresco-email-template-bootstrap.acp
最后,这里是文件 service-context.xml,其中包含有关如何导入此类 bootstrap 自定义 acp 文件(其中包含自定义电子邮件模板)的信息。 ' 希望这可以帮助。 干杯。
长话短说,您应该在 Maven 项目中进行此设置:
- 您的电子邮件模板打包为 acp(您可以使用旧的 Alfrecso Explorer 界面导出您的 ftl 模板):
src/main/amp/config/alfresco/bootstrap/emailtemplate.acp
- 您的
service-context.xml
文件在此处声明 bootstrap 导入上述 acp 文件:src/main/amp/config/alfresco/module/<yourmoduleid>/context/service-context.xml
从那里您可以通过 Alfresco JS 免费使用它 API,例如:
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";
}
XML imports can only replace/update/delete files that have their UUID set.
如果您想替换现有节点,您将需要更多地了解 import strategy :
<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>
....