cancel
Showing results for 
Search instead for 
Did you mean: 

Using custom email template

redbull
Champ in-the-making
Champ in-the-making
I would send an email from java bean.
I use the
mailHelper.notifyUser(person, nodeRef, from, role);
After that I add a new template "myTemplate.ftl" in Company Home/Data Dictionary/Email template space, which are the steps if I wanted to use it?
How I set "myTemplate.ftl" before to call mailHelper.notifyUser?

Thanks!
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
You are going to have to post more information than that.  What is mailHelper?  And is your code java script or java.
But I can't see a notifyUser method that takes a role.

What I can see are various versions that take the node ref of the template.

redbull
Champ in-the-making
Champ in-the-making
…I'm following the source code sample of Jeff Potts, "Alfresco Developer Guide".
I suppose the code refers to "notifyUser" method of  org.alfresco.web.bean.TemplateMailHelperBean.
So, my code is java. What I would do is send an email (using a custom template) from the bean associated with my custom dialog.

redbull
Champ in-the-making
Champ in-the-making
I do this:
1) get noderef for "my_custom_template.ftl"
2) get the ftl ID
3) set the custom template…  setUsingTemplate(custom_ftl_ID)
4) set the email subject …..setSubject("this is the email subject")
5) send the email ….. notifyUser(………)
It seem to work

By