ruby-on-rails - gmail newsletter/promotion tag?
问题描述
I am trying to get promotional and newsletter email messages using Gmail API. Currently, I am requesting the Gmail API based on sender, but it is not feasible. Is there a way to identify an email message as promotions or newsletters, when getting messages using Gmail API?
Is there a meta tag for newsletters or promotional messages?
Any help regarding this will be appreciated.
Thank you! J.
解决方案
The tag
you mentioned in the question is called label
in Gmail API. You can find a list of default labels in the documentation:
https://developers.google.com/gmail/api/guides/labels
I guess you are interested in CATEGORY_PROMOTIONS
. In that case, you should pass it as a query param called labelIds[]
of the request, that lists user's messages: https://developers.google.com/gmail/api/v1/reference/users/messages/list
推荐阅读
- powershell - 取得 C:\Windows 下文件的所有权
- angular - 使用 angular2 映射 JSON 键并更新另一个 JSON 中的值
- celery - 如何在 celery 客户端中使用没有导入任务模块的画布?
- .net-core - Microsoft 帐户和 IdentityServer4
- javascript - 我如何将此灯箱图片库居中?
- excel - Listmover 事件仅在运行时触发一次
- css - 如何在父元素(div)内水平堆叠元素(卡片)
- apache - Apache Camel http 组件定时器 dockerization
- linux - 创建后将 POSIX 套接字的类型从 UDP 更改为 TCP
- rust - 我可以使用局部变量隐藏 const 绑定吗?