1

Working on a customised email template in CQ5, I have created in following text file under etc/notification. The workflow is triggered when a form is filled in by the user.

From: Order Brochure <order.brochures@gmail.com>
To: ${payload.email}
CC:
Subject: Order Brochures Confirmation ${payload.BrochureID}

Dear ${payload.Name},

Thank you for your Brochure Order, your reference is ${payload.orderBrochureID}.
Your email address is {$payload.email}.

Everything in this template works fine, except for the "To: ${payload.email}". Even the "Your email address is {$payload.email}" part displays the user inputted email fine. It also works if I input a static email address in "To:".

What am I doing wrong here? Below is the error in logs

Process execution resulted in an error:
javax.mail.internet.AddressException: Illegal address in string ``''
com.day.cq.workflow.WorkflowException: javax.mail.internet.AddressException: Illegal 
address in string ``''
mmmpieee
  • 15
  • 1
  • 5
  • Is this a custom workflow step or is it the com.day.cq.collab.commons.SendEmailProcess step? – JE Bailey Dec 16 '13 at 16:50
  • This is a custom workflow step – mmmpieee Dec 16 '13 at 22:26
  • if this is a custom workflow step could you provide the code that is parsing the internet addresses? The error message that you are receiving is a null error. Which would seem to indicate that you are attempting to extract the "to" address before applying the map for the string replacement utility. – JE Bailey Dec 16 '13 at 23:57
  • Thank you for your help so far. Apologies I misunderstood your question, it is infact com.day.cq.collab.commons.SendEmailProcess with HANDLER ADVANCE: ticked EMAIL TEMPLATE PATH: /etc/notification/emailConfirm.txt EMAIL TEMPLATE: Empty – mmmpieee Dec 17 '13 at 00:40

2 Answers2

0

This error might be cumming because you are using a string as an Internet Address. you need to typecast ${payload.email} to Internet Address.

amitdeol
  • 41
  • 2
0

Remove the "CC:" it's attempting to parse the email address for this header and it's a null.

When you're dealing with these types of problems when the error is occurring within a CQ library. I recommend using a custom logger to assist with the troubleshooting.

Details of logging can be found at Logging - docs.day.com

Here's an example OSGi log configuration for your issue.

Logging Example

JE Bailey
  • 727
  • 7
  • 25