Created
March 4, 2021 11:49
-
-
Save neno-tech/4125c67a59782664205a11ffdc3f1e94 to your computer and use it in GitHub Desktop.
โค้ดส่งไลน์แจ้งเตือนไปหลายกลุ่ม
This file contains hidden or 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 myFunction() { | |
var message = 'ทดสอบส่งแจ้งเตือนแบบหลายกลุ่ม' | |
sendLineNotify(message) | |
} | |
function sendLineNotify(message) { | |
var tokens = ['token1', 'token2']; | |
for (var i = 0; i < tokens.length; i++) { | |
var options = { | |
"method": "post", | |
"payload": "message=" + message, | |
"headers": { | |
"Authorization": "Bearer " + tokens[i] | |
} | |
}; | |
UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment