How do I add 2 variables to the subject of an email notification?

Chiu
Mega Contributor

Hi guys,

Relatively new to this but I've managed to get as far as adding one variable to the email subject of a notification (which is sent out as part of a workflow).

I'm trying to use the following:

A new joiner account has been created for ${current.variables.first_name} ${current.variables.last_name}

The first name appears in the email subject but not the last name. If I use ${current.variables.last_name} on it's own, it works.

So either variable on its own works, but not when combined together. Is there some way I'm supposed to be separating the two variables?

Thanks!

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Are you creating the Notification within the Workflow itself, or are you raising an event that the Notification will respond to?  If from within the Workflow, I would highly suggest changing it from a "Notification" activity to a "Create Event" activity.

I do not create Notification activities within a Workflow because it is a pain to modify the Notification afterwards.  You need to publish a whole new Workflow instead of just modifying a Notification record instead.  And any running workflows will not pickup the new Notification.  Not worth the headache.

View solution in original post

8 REPLIES 8

Jim Coyne
Kilo Patron

Are you creating the Notification within the Workflow itself, or are you raising an event that the Notification will respond to?  If from within the Workflow, I would highly suggest changing it from a "Notification" activity to a "Create Event" activity.

I do not create Notification activities within a Workflow because it is a pain to modify the Notification afterwards.  You need to publish a whole new Workflow instead of just modifying a Notification record instead.  And any running workflows will not pickup the new Notification.  Not worth the headache.

Steps to set two fields in email subject

1) First i have created event in event registry.

goto->event registry

2) goto-> Notification

and fill all the fields which are required

send when :event is fired

what it will contain

subject:${current.variables.first_name}+" "+${current.variables.last_name}

 

3)write Business rule

when:before

condition:

script:

gs.eventQueue('event_name',current,'mail id');

Jim Coyne
Kilo Patron

Did you find a solution to your issue?  If yes, please remember to tag the correct answer and any that were helpful.

Chiu
Mega Contributor

Thanks all for the help and advice.

Sorry for the delay! Been so busy at work and it's taken me until now to test out the suggested ideas.

I've now gone down the route of using Create Event (instead of Notification). Took a little while to figure out how to use the event to generate an email notification, and also how to pass the variables into the email, but looks good now!

An added benefit is that it's easier to format the email this way.

Thanks again!

Chiu