Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created April 29, 2019 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/dee9e93886dd6c1a78b2cbc8192031d0 to your computer and use it in GitHub Desktop.
Save iaindooley/dee9e93886dd6c1a78b2cbc8192031d0 to your computer and use it in GitHub Desktop.
Send email with attachments
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