Chapter 17: Difference between revisions

From Lifeguide Wiki
Jump to navigation Jump to search
(New page: == Chapter 17: Sending e-mails == === How to automatically send an e-mail to your end-user or to yourself === ==== The formula for sending e-mails ==== To send an automated e-mail, the sa...)
(No difference)

Revision as of 09:33, 26 July 2010

Chapter 17: Sending e-mails

How to automatically send an e-mail to your end-user or to yourself

The formula for sending e-mails

To send an automated e-mail, the same set of logic commands are used. The logic uses the command sendemail followed by a unique e-mail name, e-mail address, subject heading, e-mail content, and details of when you want the e-mail to be sent out (in that order).

Written Example of Logic: after pagename1 if sendemail(unique name for e-mail, e-mail address, "Subject message for e-mail", "E-mail content”, number in seconds indicating how long after the end-user views pagename1 that you want the e-mail sent out) goto pagename2

Below is a break-down of each part of this logic:

Unique Name for the e-mail and email address

When the e-mail name is paired with an email address, it has to be unique for every single e-mail that you want to send out. So, if you are sending the same e-mail to every end-user, you can just choose a name for that email, like “welcomeemail” and when it is paired with an email address, this combination will be unique.

It becomes more complicated, however, if you want to send an email to a researcher, or other fixed person, relating to each end-user (e.g. if you need to send an e-mail each time an end-user finishes a session or if an e-mail needs to be sent out each time an end-user responds to an interaction in a certain way (e.g. if their responses indicate that a health condition is getting worse). This is because the researcher has a constant email address, so if three end-users all reach the same point in the intervention, meaning that three e-mails will need to be sent to the researcher, the email name and email address combination will be the same in each case.

The best way get around this problem is to use the append command to attach the end-user’s username onto the unique name you have given to the e-mail message. You will then have a unique name for that e-mail.

So, in the example below, the username that the end-user provided on the login page of the intervention has been appended to the string “sessionfinish” to create a unique name for each of these emails that are sent out.

append (login.uname, "sessionfinish")

E-mail address

The e-mail address then needs to come next in the logic.

When sending e-mails to end-users, the e-mail address will be different for each person. The e-mail address will probably come from a previous interaction in the intervention. Therefore putting the page name and interaction name in this section of the logic will mean that this is the e-mail address that will be used (e.g. login.email (where email is the unique name of the interaction that asked end-users to type their e-mail which can be found on the page called login)).

For sending e-mails to a fixed person such as a researcher, therapist or healthcare professional who is managing the intervention, the e-mail address can be typed as a string (e.g. "j.smith@uni.ac.uk")

Subject and e-mail content

These are the next two parts of the e-mail logic. Both need to be written as strings so will need to have quotation marks.

When writing the e-mail content you will need to use the phrase \n to put text onto a new line.

For example:

”For your chance to be entered into a prize draw for 100 pounds, please click on the link below or copy and paste it into the address line of your internet browser.\n http://www.virusdefence.org.uk/login \n Thank you.”

The e-mail text will be presented as plain text which means you cannot use bold, underline or italic text and cannot change the size or font type. Also, some symbols cannot be included into the text such as pound signs (£) or ampersands (&). At present, these symbols will need to be written as words.

Using end-user’s details in the e-mail content You can also include tailored feedback within the content of the e-mail using the append command. For example, the person’s username can be taken from the text entry interaction where they first entered it to put in the email content, by simply writing the page.interaction name into the logic (see example 1 below). Similarly, information from any text entry or numeric value interaction can be incorporated into e-mail content in the same way.

If you want to add scores that have been calculated from the interactions or responses to single/multiple choice interactions you will need to use the set function (see chapter 19). When you want the e-mail to be sent out

The final part of the logic command refers to when you want the e-mail to be sent out. This number needs to be in seconds and relates to how long after the end-user has viewed the page mentioned before it that it should be sent. So if you want the e-mail to be sent after 24 hours this will be 86400 seconds.

Because of this time element, you can have a number of e-mails stored up after the end-user has visited the page. This is especially useful if you want to send out automated reminders to users throughout the course of using the intervention.

The rest of this chapter provides two examples of logic for sending out automated e-mails; the first involves sending e-mails out to end-users and the second for sending e-mails out to a researcher (or other fixed person).