Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. var body = "Hi "+ recipient+", <p></p> You have a new research request, submitted by "+FormattedFirstName+" "+FormattedLastName+". Study details are listed below."";
  2. if (emailSent != EMAIL_SENT) {
  3. if (StudyType === "ScenarioA") {
  4. var emailsubject = ("New " + StudyType + " Study Request");
  5. var recipient = "Sabrina";
  6. MailApp.sendEmail({
  7. subject: emailsubject,
  8. htmlBody: body
  9. });
  10. sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
  11. }
  12. else if (StudyType === ScenarioB") {
  13. var recipient = "Salem";
  14. var emailsubject = ("New " + StudyType + " Study Request");
  15. MailApp.sendEmail({
  16. subject: emailsubject,
  17. htmlBody: body
  18. });
  19. sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
  20. }
  21. else if (StudyType === "ScenarioC) {
  22. var recipient = "Zelda";
  23. var emailsubject = ("New " + StudyType + " Study Request");
  24. MailApp.sendEmail({
  25. subject: emailsubject,
  26. htmlBody: body
  27. });
  28. sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement