Created
October 24, 2019 20:27
-
-
Save iaindooley/6519efe96ab9741ef4421161856a2a2e to your computer and use it in GitHub Desktop.
Email member report
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 emailMemberReport(params,signature,original_time) | |
{ | |
if(!params) | |
params = {id: new Trellinator().board("My Board").id()}; | |
if(!signature) | |
signature = "emailMemberReport"; | |
var board = new Board(params); | |
board.members().each(function(member) | |
{ | |
var output = ""; | |
board.cards().each(function(card) | |
{ | |
try | |
{ | |
card.member(member.name()); | |
output += card.name()+" in "+card.currentList().name()+": "+card.link()+"\n"; | |
} | |
catch(e) | |
{ | |
Notification.expectException(InvalidDataException,e); | |
} | |
}); | |
try | |
{ | |
MailApp.sendEmail(board.list("Email Map").card(member.name()).description(),"Your report "+Trellinator.now().butlerDefaultDate(),output); | |
} | |
catch(e) | |
{ | |
Notification.expectException(InvalidDataException,e); | |
} | |
}); | |
ExecutionQueue.push("emailMemberReport",params,signature,original_time.addHours(24)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment