Actions

Email templates

From LimeSurvey Manual

Revision as of 16:53, 7 December 2017 by Cdorin (talk | contribs)


Introduction

The email templates are used to quickly send personalized invitations, reminders, confirmations, and registrations emails to your respondents (from the survey participants table). You can also edit the standard basic (or detailed) admin notifications that are sent to the survey administrator.

To access it, go to the survey settings and click on the Email templates tab:



If you are a superadministrator (you have access to the global settings of your LimeSurvey installation, you can change the Default HTML editor mode to all your LimeSurvey users. For further details, continue reading [following wiki subsection].
  Attention : If you wish to use the inline HTML editor, do not forget to enable the HTML format for token emails! This is located in the Settings menu of your survey, under the Participant tokens tab.


Email templates panel

The email templates panel looks like this:



As it can be observed in the screenshot, the "HTML source" editor mode is used. To change it, check the the global settings of your LimeSurvey installation (if you have the superadministrator permission) or personal account settings.


To easily edit the text fields, access your account/global settings, and choose the inline editor mode.


As you can observe, six types of emails can be send to the users or admin(s):


Invitation

The invitation system is useful when you wish to send emails in bulk to all the respondents from your survey participants table who have not been already sent an invitation.

From the email templates panel, you can edit the message that reaches out those survey participants. To check which email placeholders can be used, continue reading the following wiki subsection. You can also use the Expression Manager to enhance your customization.


Reminder

The reminder system helps survey administrators remind their respondents from the survey participants table to answer to the survey.

You can edit the default format of the reminder email from the email templates panel. To check which email placeholders can be used, continue reading the following wiki subsection. The Expression Manager can help you better customize the text body of this email template.

Note: A reminder will be sent only to those participants where the "Completed" field is turned off (this means the respondent has either not taken or completed the survey) in the survey participants table.


Confirmation

If tokens are used and a participant fills out the survey, a confirmation email will be sent to his/her email address. You can deactivate this functionality from the Participant tokens panel.

Click on the Confirmation tab if you wish to edit the email template. Check the email placeholders to see which ones can be used in this type of email. You may also use the Expression Manager to enhance your customization.


Registration

If the closed-access mode is enabled, only those participants who have an entry and a unique token code associated can complete the respective survey. If you allow participants to publicly register to your survey. a new entry in your survey participants table will be created once the respondent has submitted his or her name and email address. A script that runs in the background will automatically send the respective respondent a registration email. It contains the URL with the token that needs to be accessed by the newly registered user.

Click on the registration tab to edit the format of this email. Don't forget to take a look first at which email placeholders can be used within the text body. The Expression Manager can provide additional enhancements to the body text you wish to use.


Basic & Detailed admin notifications

To get admin notifications, click on the Data management tab and type in an email address in the "Send basic admin notification email to" and another one (or the same) in the "Send detailed admin notification email to" field.

By default, the only difference between the two is related to the extra placeholder {ANSWERTABLE} that is included in the detailed admin notification email template. This allows the user who receives these kind of emails to also check the submitted answers without being needed to access the LimeSurvey installation.

However, by using the Expression Manager and the email placeholders you can customize these two email templates however you want.


Email templates fields

Each email template contains:

  • The subject of the email: The title of the email/batch of emails you want to send;
  • The email body: This field contains the text message you wish to send to the users. It may contain text, images, and email placeholders. Moreover, the Expression Manager can be used to further enhance the message you wish to deliver;
  • Email actions: It is made of the following two functions:
    • Validate expressions: It checks the logic of the email - whether the placeholders are correctly used or not. It is highly recommended to use it before sending a batch of emails. In this way you can see whether the placeholders are correctly defined or not. In the below example, a small typo exists - it is immediately emphasized in red via this function:



    • Reset this template: Once clicked, the HTML code gets reset. No text is deleted.
  • File actions: Different file-related actions can be performed here:
    • Add file: Once clicked, the following window will pop up, asking you to choose which document from the files folder you wish to send with the email:


Attachments can be added at the bottom of the email template editing interface. Email attachments are uploaded on a per survey basis.



You can also upload on the spot a file from the desktop to your LimeSurvey installation by clicking on the upload button and then selecting the file you wish to attach to the respective email template:

Once selected, double click on it and the file will be immediately displayed in the Files table, below the Add File button:



To have it permanently saved, do not forget to click on Save button located in the upper-right part of the windonw

To decide if an attachment should be sent on an individual basis it is possible to add a relevance equation to each attachment.

All functions supported by the Expression Manager can be used, as well as token attributes if the survey uses tokens.

In case of a notification or confirmation template it is also possible to use question codes used in the survey.

  Attention : Please note that:
  • When a file can not be found on the file system, the email will be sent without attachment.
  • Exporting/importing a survey does not export the uploaded files. The settings for attachments will be maintained, as will the relevance equations.



Using replacement function.

In the email template , you can use some specific keywords to use token information: see Emails placeholders to have the complete list of placeholders.

A good example is the usage of the plain link to the survey instead of a long url.

Example: Create a nice link to start the survey

  1. First open up the email-templates editing and choose 'Invitation' on the upper tabs.
  2. Then write the text you want to appear as link to start the survey.
  3. Then select that text.

  1. Add the placeholder for the plain link @@SURVEYURL@@ and choose other from the protocol-select-box

Now if you send out your invitation mails, the link to start the survey will be a link and not an url.


Email placeholders

You may observe in the body and/or subject of the message different email placeholders. Their role is to connect the email you wish to send to each token entry from the survey participants list. In this way, their data is automatically taken and you will not have to manually type the details of the respective survey participant (e.g. first name, administrator email, survey description, and so on).

You can find below the field names that are allowed in invitation and reminder email templates in LimeSurvey. They must be included in the body message! When sending out the emails, these field names will be already replaced in the preview of your invitation/reminder email.

{ADMINEMAIL} Email of the Survey admin
{ADMINNAME} Name of Survey Admin
{SURVEYNAME} Title of your survey
{SURVEYDESCRIPTION} Description of your survey

The following field names are allowed in invitation/reminder emails (subject and/or body) and will be replaced while sending out the mails:

{EMAIL} Email of the recipient
{FIRSTNAME} First Name
{LASTNAME} Last Name
{SURVEYURL} The URL pointing to the survey start - if you are sending HTML emails this will be a fully linked HTML version
@@SURVEYURL@@ The URL pointing to the survey start - this is the barebone link. Use this if you want to integrate the link in your custom HTML elements somewhere (available in v1.90 and later)
{OPTOUTURL} The URL to deactivate sending of mail for this survey  - this will be a fully linked HTML version
{TOKEN} Token to access the survey
{ATTRIBUTE_1} Attribute 1
{ATTRIBUTE_2} Attribute 2 (...and so on for more attribute fields)

If your survey is not anonymous, the following field names are available to insert token data in survey text and javascript.

{TOKEN:EMAIL} Email of the recipient
{TOKEN:FIRSTNAME} First Name
{TOKEN:LASTNAME} Last Name
{TOKEN} Token to access the survey
{TOKEN:ATTRIBUTE_1} Attribute 1
{TOKEN:ATTRIBUTE_2} Attribute 2 (and so on for more attribute fields)

Note: You can use these fields in confirmation and notification email template too.

Note:

  • If your survey is using anonymized responses then token-related placeholders will not work in notification email templates.
  • You can use Expression Manager to use expressions for tailoring an email (New in 1.92 ). Please have a look at the Expression Manager HowTos for an example.

Also have a look at the examples on using information from tokens table.

Edit email templates

  1. Invitation Email Subject: The subject line for the invitation email that gets sent out when tokens are used with your survey.
  2. Invitation Email: This is the text for the invitation email that gets sent out when tokens are used with your survey. This is initially filled by the default invitation message (from the language files) but you can modify it to suit yourself. If you are using English as your base language, the default invitation and reminder text can be found in the limesurvey/tokens.php file. Of course if you don't plan to use tokens on your survey, whatever is in this field is irrelevant.  You can use the following "form" fields to insert individualized information in each email:
  • {FIRSTNAME} - gets replaced with the token table's "firstname" value
  • {LASTNAME} - gets replaced with the token table's "lastname" value
  • {SURVEYNAME} - gets replaced with your surveys name
  • {SURVEYDESCRIPTION} - gets replaced with your surveys description
  • {ATTRIBUTE_1} - gets replaced with the token table's "attribute_1" value
  • {ATTRIBUTE_2} - gets replaced with the token table's "attribute_2" value and so on
  • {SURVEYURL} - gets replaced with the fully qualified URL to this particular survey - in HTML emails this is a fully linked HTML link
  • @@SURVEYURL@@ - Gets replaced with the survey barebone link. Use this if you want to integrate the link in your custom email HTML (available in v1.90 and later)
  • {OPTOUTURL} - gets replaced with the URL for a respondent to opt-out of this particular survey

Note that these "form fields" apply to the following email fields.

  1. Email Reminder Subject: The subject line for the reminder email that gets sent out from the tokens tool
  2. Email Reminder: This is the text for the reminder email that gets sent out when tokens are used with your survey. See "invitation email" for specific details on how this field is used.
  3. Confirmation Email Subject: When tokens are used, this is the subject line of the email that gets automatically sent to participants after completion of the survey
  4. Confirmation Email: This is the text of the email that gets sent to users after completion of the survey. Delete/blank this text remove the confirmation email sending.
  5. Public Registration Email Subject: This is the subject line for the invitation email sent to members of the public who register for a survey.
  6. Public Registration Email: This is the text for the invitation email sent to members of the public who register for a survey. The same "form fields" apply in this email as in the earlier ones.


Participant opt-out

When you use the {OPTOUTURL} tag in your invitation/reminder email, your participants have the possibility to opt out of this particular survey by just clicking on the related URL in the email - so you don't harass them with reminder emails. A participant that opted out of your survey will have the email status 'OptOut' set in the token.



P.S. CHECK THE HTML EDITOR YOU USE