sgapiSetHTMLEmail(%%questionID,%%value,%%language = "English")

Important Update to Custom Scripting

SurveyGizmo's CustomScript Action now supports the LUA programming language. Visit our NEW Lua Scripting Resources!

Legacy Custom Scripting Language Deprecation Plans 

  1. New accounts (created after October 29, 2018) will only have the option to use Lua in scripts.
  2. 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.
  3. 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 an HTML 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")
{
    sgapiSetHTMLEmail(%%emailAction,%%noMessage,"English");
}