Gmail API Canned Responses

六眼飞鱼酱① 提交于 2019-12-25 02:09:25

问题


I am trying to retrieve list of canned responses in Gmail with the help of Gmail API in javascript, but it seems there is no API end point to do so.

Is there any other way to achieve it programmatically?


回答1:


You can retrieve the list of canned responses using the Gmail API.

All the canned responses are stored as "draft messages" even if you delete all the draft messages, you can still retrieve the canned responses by listing them.

https://developers.google.com/gmail/api/v1/reference/users/drafts/list

Unfortunately, this will return the full list of the draft messages, including the canned responses. In order to address this you can either:

  • Add a <keyword> and use the param q as query to search for this <keyword>. For example: subject:<keyword>

  • (Not recommended) Delete the existing draft messages in order to retrieve only the list of canned responses. Note that if you do this, later on you wont be able to have draft messages, otherwise, your script will return these drafts as well.



来源:https://stackoverflow.com/questions/56446142/gmail-api-canned-responses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!