Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var body = "Hi "+ recipient+", <p></p> You have a new research request, submitted by "+FormattedFirstName+" "+FormattedLastName+". Study details are listed below."";
- if (emailSent != EMAIL_SENT) {
- if (StudyType === "ScenarioA") {
- var emailsubject = ("New " + StudyType + " Study Request");
- var recipient = "Sabrina";
- MailApp.sendEmail({
- to: "sabrina@gmail.com",
- subject: emailsubject,
- htmlBody: body
- });
- sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
- }
- else if (StudyType === ScenarioB") {
- var recipient = "Salem";
- var emailsubject = ("New " + StudyType + " Study Request");
- MailApp.sendEmail({
- to: "salem@gmail.com",
- subject: emailsubject,
- htmlBody: body
- });
- sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
- }
- else if (StudyType === "ScenarioC) {
- var recipient = "Zelda";
- var emailsubject = ("New " + StudyType + " Study Request");
- MailApp.sendEmail({
- to: "zelda@gmail.com",
- subject: emailsubject,
- htmlBody: body
- });
- sheet.getRange(startRow + i, 23).setValue(EMAIL_SENT);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement