Send Email with Flowscript

Compatibility:IdSurvey 7IdSurvey 8

With IdSurvey you can automatically send an email in any page of the questionnaire.

To do this you need to create a Flowscript with the sendmail() function.

sendMail(from, to, subject, text);

 
In addition, you can save the result of the dispatch in a custom field using this syntax:

{CustomField} = sendMail(from, to, subject, text);

 

Notes:

  • Make sure you have verified the domain of the email you will use as sender in EmailSender and have Email licenses available.
  • Thanks to FlowScript it is possible to set a condition to send the email only under certain circumstances. For example, if the respondent has selected a certain answer.
  • Any apostrophes contained in the text of the email must be written before the back-slash (\’) character. This prevents flowscript from interpreting the apex as the end of the string.
  • You can send the email to a specified recipient or recall the contact field dynamically.

 

Step 1

Open the flowscript editor by clicking on the gear of the desired page. In this example we add the flowscript to the last page of the questionnaire.

send email with flowscript

 

Step 2

Write the full subject line and text function of the email. In this case we use the {email} field of the contact as recipient.

{email_result}=sendMail('noreply@idweb.it', {email}, 'Completed interview confirmation', 'Ciao, thank you for joining our survey.');

The email will be sent to your contact email when you click the next button on the page with flowscript.

The result of the delivery will be saved in the custom email_result field.

send email with flowscript