Answer the question
In order to leave comments, you need to log in
POST callback when receiving an email in Gmail?
I'd like to send a request like mydomain.com/api/method/{params} to my server every time I receive an email in Gmail. Any ideas for implementation?
Answer the question
In order to leave comments, you need to log in
habrahabr.ru/post/145447
Only use a script like this
function my_notification()
{
var threads = GmailApp.getUserLabelByName('SMSnotify').getThreads(); //переменная, в которой хранится коллекция цепочек с ярлыком SMSnotify
if(threads == 0) return; // прекращение выполнения, если новых цепочек нет
for(i in threads)
{
var text = threads[i].getFirstMessageSubject();
text = text.split("Re:").join("").trim();
UrlFetchApp.fetch("<ваш урл>" + encodeURIComponent(text));
}
GmailApp.getUserLabelByName('SMSnotify').removeFromThreads(threads); //снимаем метки "SMSnotify" с цепочек
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question