Send One Notification with Three Different Subjects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 03:23 AM
Hello Experts,
I have a catalog item with a variable called "reason for replacement." If the reason for replacement is "broken," I want to send a notification with the subject "Broken." If it's "lost," I want to send a notification with the subject "Lost," and if it's "upgrade," I want to send a notification with the subject "Upgrade." The content of the notification remains the same for all three reasons, but I don't want to create three separate notifications. Instead, I want to manage all of this within a single notification. Could someone please guide me on how to achieve this?
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 03:59 AM - edited 02-17-2024 04:02 AM
Hi @Mark Wood ,
Your can configure the subject line in email object via email script and use this email script in notification.
Also u can check if that variable can be added in subject line via dot walking.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2024 04:37 AM - edited 02-17-2024 04:38 AM
try this :
create mail script named setSubject as below example :
(function runMailScript(current, template, email, email_action, event) {
if(current.variable=='lost')
{
email.setSubject('The item is Lost ');
}
else if (current.my_variable=='broken')
{
email.setSubject('The item is broken ');
}
else if (current.my_variable=='upgrade')
{
email.setSubject('The item is upgraded ');
}
})(current, template, email, email_action, event);
Call the mail script in the notification body in format
${mail_script:setSubject}
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....