Skip to content

Instantly share code, notes, and snippets.

@ChaiyachetU
Created September 9, 2021 11:22
Show Gist options
  • Save ChaiyachetU/bd21cd9adc7c2c1ebd8420a9ad8a161b to your computer and use it in GitHub Desktop.
Save ChaiyachetU/bd21cd9adc7c2c1ebd8420a9ad8a161b to your computer and use it in GitHub Desktop.
// send email message to line notify
function sendMessageToLineNotify(message, accesssToken) {
const lineNotifyEndPoint = "https://notify-api.line.me/api/notify";
const options = {
"method": "POST",
"headers": {
"Authorization": "Bearer " + accesssToken,
"Content-Type": " application/x-www-form-urlencoded"
},
"payload": {
"message": message
},
};
try {
UrlFetchApp.fetch(lineNotifyEndPoint, options);
Logger.log("Send Notify Completed!");
} catch (error) {
Logger.log(error.name + ":" + error.message);
return;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment