Created
January 19, 2020 22:37
-
-
Save iaindooley/c285a50ae3d9fc3d5b89dfb5c0be5398 to your computer and use it in GitHub Desktop.
Send SMS from Trello
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 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