by Oliver Choy

Created

February 20, 2012

Many times in the past I had been asked by clients on how to specify multiple email recipient addresses in the CQ email templates, due to the lack of documentation. They tried various options like comma separator or semi-colon separator, and failed to find the right solution.

Let’s take a look at the welcome notification email template from Geometrixx:

From: Geometrixx Admin
To: ${payload.email}
BCC: tripod@day.com
Subject: Signup for ${payload.fullname}
 
Dear ${payload.fullname}
 
Please find your account here: http://www.day.com/
Your password is: ${payload.temppassword}
 
regards
Geometrixx Team
 
-----------------------------------------
How this template works:
 
Use the email headers you need and seperate them with a blank line
from the message body. you can replace variables using the ${...} syntax.
You can get a list of all workflow related variables by including the "properties"
variable (see example below).
 
You can access all properties of a JCR payload (i.e. a JCR node) by using the
"payload." prefix. for example, if you create a 'title' property with a form,
you can include it with ${payload.title}.
 
-----------------------------------------
All Workflow properties:
${properties}

The solution is in fact very easy, just not well-documented. You simply separate the email addresses into separate “To” lines, like below:

From: Geometrixx Admin
To: ${payload.email}
To: address1@customername.com
To: address2@customername.com
BCC: tripod@day.com
Subject: Signup for ${payload.fullname}
 
Dear ${payload.fullname}
 
Please find your account here: http://www.day.com/
Your password is: ${payload.temppassword}
 
regards
Geometrixx Team

Now have fun playing with the email templates :)

COMMENTS

  • By new1 - 3:45 PM on May 7, 2012  

    Thank You for the post. This is really helpful. I however have one question and will really appreciate your response.

    The requirement is that the author should be able to add emails for notification just before a step is selected to be complete in the workflow. Can you point it out which component needs to be overridden to create a custom dialog for “complete work item”.

    Thanks