The Zurich release has arrived! Interested in new features and functionalities? Click here for more

email script

abhisek
Tera Contributor

I have a select box variable for example 'partner' in my catalog item, which is user details as question choices(text is the name and value is the email id).

I have to send notification to the partner field value which was selected during raising the request. For example partner field value is 'ABC'(email is 'abc@exmpl.com') along with the email body.

How can I implement this using email script and notification?

 

Can anyone please help me out, it is very urgent.

 

12 REPLIES 12

You could create a Decision Table for this, which would provide the right e-mail address (abc@exmpl.com) based on the value (abc) selected in variable 'partner'.

Decision tables have an API that make that easy: provide the value as input and it will provide the right e-mail address as output/return value.

For details about the API: new sn_dt.DecisionTableAPI().getDecision().

abhisek
Tera Contributor

Hi @Weird 

We are not allowed to use event and business rule. I have to achieve it using system notification and email script. Email script is required to send notification to the partner field value which was selected during raising the request. Email subject and body I have to populate from the notification itself. 

Thanks.

That's (not using events) kinda' impossible, because the system itself uses notifications anyway to trigger notifications :-).

 

If you are using Flows you can "simulate" not using events by defining the Send when attribute of you notification to be "Triggered" and use a "Send Notification" activity in the Flow for the Catalog item to trigger that notification:

12.png

 

13.png

 

14.png

abhisek
Tera Contributor

I am implementing it through notification and email script. Using email script I am getting that user's email id in the system log but that user not receiving the notification. In the system notification itself I am sending notification to a particular group and user, both are receiving but the user whom I am sending notification through email script not receiving even though I am getting that user's email id in the system log.

That might mean your e-mail script is not properly added to the notification or the script is faulty.

E.g. it may be that when looking at the notification it looks OK, like:

15.png

but inspecting the source reveals that there are HTML tabs inside invalidating the special token:

16.png

Or it may mean that the user has no valid e-mail address, or that the user has opted out from notifications, etc.

 

What I want to say there can be many reasons, some not even related to scripts and configuration, you need to provide more information and do local checks.