首页 > 解决方案 > 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.

标签: ruby-on-railsgetgmail-api

解决方案


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


推荐阅读