Trigger Google Apps Script by email

后端 未结 3 1369
执笔经年
执笔经年 2020-12-08 22:30

I\'m looking for examples of a pattern where a demon script running within a GoogleAppsForBusiness domain can parse incoming email messages. Some messages will will contain

3条回答
  •  天命终不由人
    2020-12-08 22:59

    There are two ways. First you can use Google pub/sub and handle incomming notifications in your AppScrit endpoint. The second is to use the googleapis npm package inside your AppScript code an example here. Hope it helps.

    These are the steps:

    • made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing?
    • made a pubsub topic
    • made a subscription to the webhook url
    • added that url to the sites i own, i guess? I think I had to do DNS things to confirm i own it, and the error was super vague to figure out that was what i had to do, when trying to add the subscription
    • added permission to the topic for "gmail-api-push@system.gserviceaccount.com" as publisher (I also added ....apps.googleusercontent.com and youtrackapiuser.caps@gmail.com but i dont think I needed them)
    • created oauth client info and downloaded it in the credentials section of the google console. (oauthtrash.json)

提交回复
热议问题