Skip to content

Instantly share code, notes, and snippets.

@mhawksey
Created January 13, 2015 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mhawksey/2a4101b7492f08413a28 to your computer and use it in GitHub Desktop.
Save mhawksey/2a4101b7492f08413a28 to your computer and use it in GitHub Desktop.
Google Apps Script snippet that send a thank you response based on supplied email
function sendEmail(e) {
var emailTo = e.namedValues['20. Email confirmation (and badge)'][0];
if (emailTo != ""){
var text = 'Thank you for taking time to complete the ALT Annual Survey 2014. You can help us get a better understanding of how learning technology is used across sectors by sharing this link to the survey with your community: http://go.alt.ac.uk/ALT-Survey-2014\n\nYou might also use this suggested text in a tweet:\n\n " Just completed the ALT Annual Survey 2014 exploring use of learning technology across sectors. Have your say http://go.alt.ac.uk/ALT-Survey-2014 #altc "';
var textHtml = HtmlService.createHtmlOutputFromFile('mailText').getContent();
MailApp.sendEmail(emailTo,
"Thank you for completing the ALT Annual Survey 2014",
text,
{replyTo:"enquiries@alt.ac.uk", htmlBody: textHtml});
}
}
<div>
<p>Thank you for taking time to complete the ALT Annual Survey 2014. You can help us get a better understanding of how learning technology is used across sectors by sharing this link to the survey with your community: <a href="http://go.alt.ac.uk/ALT-Survey-2014">http://go.alt.ac.uk/ALT-Survey-2014</a>.</p>
<p>You might also use this suggested text in a tweet:</p>
<p>" Just completed the ALT Annual Survey 2014 exploring use of learning technology across sectors. Have your say <a href="http://go.alt.ac.uk/ALT-Survey-2014">http://go.alt.ac.uk/ALT-Survey-2014</a> #altc " [<a href="http://twitter.com/intent/tweet?text=Just completed the ALT Annual Survey 2014 exploring use of learning technology across sectors. Have your say http://go.alt.ac.uk/ALT-Survey-2014 #altc">tweet</a>]</p>
<p>Or display this badge on your website:</p>
<p align="center"><a href="http://go.alt.ac.uk/ALT-Survey-2014" alt="Participate in the ALT Annual Survey 2014"><img src="https://www.alt.ac.uk/sites/alt.ac.uk/files/ALT-Survey-Badge-2014-SML.png" title="ALT Annual Survey 2014 Participant"/><br />
Participate in the ALT Annual Survey 2014</a></p>
<p align="center"><em>If you would like to embed this badge and help promote the survey you can use this html markup</em>:<br/>
<code>&lt;a href=&quot;http://go.alt.ac.uk/ALT-Survey-2014&quot; alt=&quot;Participate in the ALT Annual Survey 2014&quot;&gt;&lt;img src=&quot;https://www.alt.ac.uk/sites/alt.ac.uk/files/ALT-Survey-Badge-2014-SML.png&quot; title=&quot;ALT Annual Survey 2014 Participant&quot;/&gt;&lt;br /&gt;Participate in the ALT Annual Survey 2014&lt;/a&gt;</code></p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment