Created
September 9, 2021 11:22
-
-
Save ChaiyachetU/bd21cd9adc7c2c1ebd8420a9ad8a161b to your computer and use it in GitHub Desktop.
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
// 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