Skip to main content
August 22, 2022
Question

Send email to multiple recipients

  • August 22, 2022
  • 6 replies
  • 0 views

I'm trying to send an email to group members, I sent it successfully, but how to call the recipients one by one in the body of the mail

e.g.

Dear ABC, XYZ, PQR

I want to show like

Dear ABC 

6 replies

harshitb6843
August 22, 2022

For this, you can use the join array function after "dear". Something like 

concat("Dear ",joinarray(pv!users,";"))

August 22, 2022

I tried It is showing me like that in one email, I want to three email using one name only

Dear ABC; XYZ; PQR

harshitb6843
August 22, 2022

You mean you want an email for individual name? If yes, then you can run a loop in the process model using a counter variable. Set the counter to 1 when the PM starts and check the value of it in an XOR. It should be less than or equal to the count of pv!users. Then you can use concat("Dear "pv!users[pv!counter])

August 22, 2022

You can use MNI to do that. Steps below:

1) Create a process model with Send email node

2) make it as a MNI.

3) Use tp!InstanceIndex to get the particular index name to send the email. for example: ="Dear "&cons!OB_WWX_TEAM[tp!instanceindex]. Gere OB_WWX_TEAM is my group.

Second Approach:

Create a for loop in process model by using XOR gateway. For this, you can create a process variable name index and increase it by 1 in every iteration and to get the name use index function.

August 22, 2022

mikes0011
Brainy
August 22, 2022

I'd recommend you use a prior node to save an array of usernames (created by the groupMembers function) to a text array PV; that will allow you to more easily and confidently iterate over said PV to execute and control the MNI for your email node.

The Expression Guru