V
V
Vladislav Faust2015-08-03 16:15:04
gmail
Vladislav Faust, 2015-08-03 16:15:04

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

2 answer(s)
V
Vladislav Faust, 2015-08-11
@vladfaust

Found a solution: CloudMailln

A
Alexander Taratin, 2015-08-03
@Taraflex

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 question

Ask a Question

731 491 924 answers to any question