Is it possible to set the subject of an email client template using an email script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 08:02 AM
I have created a custom email client template in my pdi which uses the London version.
I would like the subject to be set using an email script.
I am able to set the content of the email client template using the following for example:
template.print('hello world');
However, if I try to set the subject of the email client template using the following code in an email script:
email.setSubject('hello world');
This does not set the subject.
I have checked the system log, the email seems to be returning a value of null (please see attached screengrab).
Does anyone have any suggestions of how I would be able to set the subject using an email script? Or is there a known error that anyone is aware of? It is not an option for me to use the subject field provided in the email client template.
Thanks,
Sue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2022 02:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 03:31 AM
Hello Sue, Everyone struggling with the subject field on Email Client Template.
You cannot use email object when you call mail script from Email Client Template -
email: EmailOutbound object (null when called from Client Template)
There is a workaround how to insert anything into subject:
- Insert a unique string to a template subject, so we can filter by it later f.e. "IncidentCommunicationPlanEmailSubjectToReplace"
- Create before insert BR on sys_email table, condition - Subject is "IncidentCommunicationPlanEmailSubjectToReplace"
- You can run any Script Include inside your Business rule to generate your subject
- Then just do current.subject = .....
We were using it to create dynamic subject based on recipient's languages.
New subject will be generated before modal window used for sending mail pops-up so the sender will never see "IncidentCommunicationPlanEmailSubjectToReplace" subject.