This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test() { | |
Logger.log("[METHOD] test"); | |
var ssResponses = SpreadsheetApp.getActive().getSheetByName("Form responses 1"); | |
var testRange = ssResponses.getRange(2,1,1,ssResponses.getLastColumn()); | |
sendEmail(testRange); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shortenPriorityText(text) { | |
Logger.log("[METHOD] shortenPriorityText"); | |
switch(text) { | |
case "Critical = Bug is already producing consequences": | |
return "CRITICAL"; | |
case "High = Consequences will come with delay": | |
return "HIGH"; | |
case "Regular = Needs to be done": | |
return "REGULAR"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var emailRecipients = "ken@madebymany.com"; | |
var emailSubject = bugPriority+": "+bugName+" ("+bugEmail+")"; | |
var emailBody = "<h3>A bug has been reported by "+bugEmail+":</h3><hr /> \ | |
<p> \ | |
<h1 style='line-height:90%'>"+bugPriority+": "+bugName+"<br /> \ | |
<span style='font-size:60%'>("+bugDate+")</span></h1> \ | |
</p><hr /> \ | |
<p> \ | |
<strong>BUG TYPE:</strong><br /> \ | |
"+bugType+" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MailApp.sendEmail({ | |
to: emailRecipients, | |
subject: emailSubject, | |
htmlBody: emailBody | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugPriority = shortenPriorityText(bugPriority); | |
if (bugAdditionalInfo.length == 0) bugAdditionalInfo = "None"; | |
var bugFollowUp = ""; | |
if (bugScreenshots.length != 0) bugFollowUp = bugFollowUp.concat("<li>Ask for screenshots or additional files</li>"); | |
if (bugEmailUpdates.length != 0) bugFollowUp = bugFollowUp.concat("<li>Provide status updates to "+bugEmail+"</li>"); | |
if (bugFollowUp.length == 0) bugFollowUp = "<br />None"; | |
else bugFollowUp = "<ul>"+bugFollowUp+"</ul>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bugPriority = row[2]; | |
var bugName = row[3]; | |
var bugEmail = row[1]; | |
var bugDate = row[0]; | |
var bugType = row[5]; | |
var bugDescription = row[4]; | |
var bugSteps = row[6]; | |
var bugExpectedBehavior = row[7]; | |
var bugMacOS = row[9]; | |
var bugWindows = row[10]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var values = range.getValues(); | |
var row = values[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendEmail(range) { | |
Logger.log("[METHOD] sendEmail"); | |
// FETCH SPREADSHEET // | |
// EXTRACT VALUES // | |
// CLEAN VARIABLES // | |
// PREPARE EMAIL // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit(e) { | |
Logger.log("[METHOD] onFormSubmit"); | |
sendEmail(e.range); | |
} | |
function sendEmail(range) { | |
Logger.log("[METHOD] sendEmail"); | |
var values = range.getValues(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit(e) { | |
Logger.log("[METHOD] onFormSubmit"); | |
sendEmail(e.range); | |
} |
NewerOlder