Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created January 19, 2020 22:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/c285a50ae3d9fc3d5b89dfb5c0be5398 to your computer and use it in GitHub Desktop.
Save iaindooley/c285a50ae3d9fc3d5b89dfb5c0be5398 to your computer and use it in GitHub Desktop.
Send SMS from Trello
function sendSmsFromTrello()
{
new Trellinator().board("My Contacts").cards().each(function(card)
{
sendSms(card.customFieldValue("Mobile Number"),"Hi there "+card.customFieldValue("First Name")+"!");
});
}
//TAKEN FROM: https://www.twilio.com/blog/2016/02/send-sms-from-a-google-spreadsheet.html
function sendSms(to, body) {
var messages_url = "https://api.twilio.com/2010-04-01/Accounts/YOURACCOUNTSID/Messages.json";
var payload = {
"To": to,
"Body" : body,
"From" : "YOURTWILIONUMBER"
};
var options = {
"method" : "post",
"payload" : payload
};
options.headers = {
"Authorization" : "Basic " + Utilities.base64Encode("YOURACCOUNTSID:YOURAUTHTOKEN")
};
UrlFetchApp.fetch(messages_url, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment