Important Update to Custom Scripting
The CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!
- New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
- As of October 29, 2018 Custom Scripting Actions will default to Lua as the scripting type in the Custom Scripting Action for accounts created before this date. You will be able to switch to the Legacy Custom Scripting; though we highly encourage using Lua.
- In the long term, Legacy Custom Scripting Actions will be switched to read-only. The exact date on this is to be determined; we will send notifications well ahead of time.
This function sets the content of the TEXT version of a send email action.
Parameters
- %%questionID - The ID of the send email action for which you are specifying content.
- %%value - The content you wish to use (string).
- %%language - Using the language parameter you can specify the content for each language of your survey. The values are the languages available in the translation menu. %%language must be title case e.g. %%language = "English"
Example
This is a good way to customize multiple email autoresponders (a.k.a. send email actions) depending on how the survey is answered.
%%question1 = sgapiGetValue(2); %%emailAction = 3; %%yesMessage = "You said yes!"; %%noMessage = "You said no!"; if (%%question1 == "yes") { sgapiSetHTMLEmail(%%emailAction,%%yesMessage,"English"); } if (%%question1 == "no") { sgapiSetTEXTEmail(%%emailAction,%%noMessage,"English"); }