Created
April 29, 2019 00:40
-
-
Save iaindooley/dee9e93886dd6c1a78b2cbc8192031d0 to your computer and use it in GitHub Desktop.
Send email with attachments
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 notifyWithAttachments(notification) | |
{ | |
var card = new Notification(notification).addedCard("Internal review"); | |
try | |
{ | |
var msg = card.name()+"ready for review "+card.link()+" \n\nHere are the attachments\n\n"+card.attachments().find(function(att) | |
{ | |
return att.link(); | |
}).asArray().join("\n"); | |
} | |
catch(e) | |
{ | |
Notification.expectException(InvalidDataException,e); | |
var msg = "card ready for review, no attachments present! "+card.link(); | |
} | |
new IterableCollection(card.board().card("Emails to Notify").description().split("\n")).each(function(email) | |
{ | |
MailApp.sendEmail(email, card.name()+" ready for review", msg); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment