Dynamic value in email template TO

Ekata
New Contributor II
New Contributor II

Hi Team,

We have a requirement to have an analytic in place to trigger email to the helpdesk as per their location if the first name or last name is null or invalid.

For example, if user first name is NULL and user's location is Paris the email should go to parisTSGhelpdesk@abc.com

Can we achieve this without using dataset. Please advise.

Regards

6 REPLIES 6

dgandhi
All-Star
All-Star

Please check below solution:

1. Create one analytics with below sample query

select u.username,u.email
from users u
where (u.firstname is null or u.firstname = '')
and u.location='Paris'

2. Create one email template and in email template to section , add the dl that you mentioned 'parisTSGhelpdesk@abc.com'

3. In your analytics config, attach above created email template.

4. Now when you run the analytics , the output of the analytics will be sent to above mentioned dl

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Ekata
New Contributor II
New Contributor II

Hi Devang,

Thanks for the response but this is a direct approach for 1 location, I have 85 locations for which it should check and send the email template. How we can use it that time.

Location value will be there in users table.

Modify the query like below u.location in ('Paris','XYZ','ABC')

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Ekata
New Contributor II
New Contributor II

Hi,

Thanks but I wanted to know about the TO section. 

You can use if else conditions but problem I foresee is, if the logic length goes beyond 1024 chars then it will fail because TO column is varchar(1024)


Regards,
Saathvik

You can store values in endpoints cp and use in TO