The ${content} variable content does not appear in messages (emailDocumentSend event)
Our problem
When sending an email by a right-click on a document (emailDocumentSend event) the text typed in the mail editor is never sent.
There is a ${content} variable in the template file. It seems that the content of this variable is not used.
We encounter this problem with a personalized email template, but also with the default configuration.
Thanks for your help,
Patrice
Our config
*The template file : emailDocument.ftl *
> $ cat my_emailDocument.ftl
> ${content}
>
> <p>[On passe ici 1]
> Vous pouvez consulter le document en suivant ce lien : <a href="${docUrl}">${htmlEscape(docTitle)}</a>
> </p>
> </p>
The notifications config file : notification-config.xml
$ cat my-notification-config.xml
<?xml version="1.0"?>
<component name="org.my.notification.service.NotificationContrib">
<...>
<extension point="notifications" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
<...>
<notification name="Email document"
enabled="true" availableIn="all" autoSubscribed="true"
subject="${mailSubject}"
template="my_emailDocument"
label="label.nuxeo.notifications.email.document" channel="email">
<event name="emailDocumentSend"/>
</notification>
<...>
</extension>
<extension point="templates" target="org.nuxeo.ecm.platform.ec.notification.service.NotificationService">
<...>
<template name="my_emailDocument" src="email_templates/my_emailDocument.ftl"/>
<...>
</component>
and the resulting message sent
NO ADDED TEXT HERE, AT THE LOCATION OF THE VARIABLE ${content} !
> [On passe ici 1] Vous pouvez consulter le document en suivant ce lien : Test_Note_1
> Ce courriel vous a été adressé par Jean TOTOTESTEUR (toto).
Solution of this problem found in https://doc.nuxeo.com/display/ADMINDOC60/Hotfixes+Management+for+Nuxeo+Platform+6.0
(5.8) Variable's names have been changed : ${mailContent} instead of ${content} :-(
It's OK now. Patrice
Manual Notification on a Document
NXP-16031 fixed a conflict between the mail subject
parameter and subject
form field . For example, if the notification subject was defined by
subject=`
“[MyNuxeoApp] ${subject}“ the rendered subject did not contain the prefix
MyNuxeoApp . [NXP-16031](https://jira.nuxeo.com/browse/NXP-16031) brings disambiguation by renaming the
subjectand
content` form fields.
Therefore, if you have overridden the “Email document” notification or its related template emailDocument
, you have to update them to use mailSubject
and mailContent
strings instead of subject
and content
ones. Your code should look like:
Email Document notification subject="[MyNuxeoApp] ${mailSubject}"
emailDocument template ${mailContent}