Email Substitutions Find and Replace

482
2
Jump to solution
05-25-2018 11:04 AM
AlexP_
by
Occasional Contributor III

Hello,

 Can you please explain how to use email substitution find and replace? I am not clear. 

I am following these documentation Send email notifications - Crowdsource Manager | ArcGIS for State Government 

Please advise. Thank you!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AllisonMuise1
Occasional Contributor III

This configuration allows you to swap out one piece of text for another in the outgoing email. Anywhere a value in the Find column is found in the email text or body, it will be replaced with the corresponding value from the Replace column. If the value in the Replace column is a field in the layer, the Find value will be replaced with the value in that field in the triggering feature.

For example, if the feature triggering the email contains an attribute (NAME) with the name of the person who'll receive the email, you might want to address that person by name in the email. Another use case would be to include a reference number in the subject line of the email (assuming the feature contains that info).

To do this, write out your email text in an HTML file. You can start with one of the samples that come with the script. If you'd like to address the person by name in the email you might put something like Dear {name}, as the first line of the message. Really, {name} could be any string, but I suggest using something that is clearly variable-like and unlikely to appear elsewhere in the message in a literal form.

In the tool, list your variable for the person's name ({name})in the Find column, and pair it up with the name of the field that contains the person's name (NAME) in the Replace column. 

The same principle applied to substitutions in the subject - just include the variable in the configured Subject text, instead of the HTML body.

View solution in original post

2 Replies
KoryKramer
Esri Community Moderator

Adding the Solutions‌ and Local Government Solutions Users‌ to see if somebody in those spaces can help.

AllisonMuise1
Occasional Contributor III

This configuration allows you to swap out one piece of text for another in the outgoing email. Anywhere a value in the Find column is found in the email text or body, it will be replaced with the corresponding value from the Replace column. If the value in the Replace column is a field in the layer, the Find value will be replaced with the value in that field in the triggering feature.

For example, if the feature triggering the email contains an attribute (NAME) with the name of the person who'll receive the email, you might want to address that person by name in the email. Another use case would be to include a reference number in the subject line of the email (assuming the feature contains that info).

To do this, write out your email text in an HTML file. You can start with one of the samples that come with the script. If you'd like to address the person by name in the email you might put something like Dear {name}, as the first line of the message. Really, {name} could be any string, but I suggest using something that is clearly variable-like and unlikely to appear elsewhere in the message in a literal form.

In the tool, list your variable for the person's name ({name})in the Find column, and pair it up with the name of the field that contains the person's name (NAME) in the Replace column. 

The same principle applied to substitutions in the subject - just include the variable in the configured Subject text, instead of the HTML body.