google.mail#

class platypush.plugins.google.mail.GoogleMailPlugin(*args, **kwargs)[source]#

Bases: GooglePlugin

GMail plugin. It allows you to programmatically compose and (TODO) get emails

Requires:

  • google-api-python-client (pip install google-api-python-client)

  • oauth2client (pip install oauth2client)

__init__(*args, **kwargs)[source]#

Initialized the Google plugin with the required scopes.

Parameters:

scopes (list) – List of required scopes

compose(sender, to, subject, body, files=None)[source]#

Compose a message.

Parameters:
  • sender (str) – Sender email/name

  • to (str) – Recipient email or comma-separated list of recipient emails

  • subject (str) – Email subject

  • body (str) – Email body

  • files (list) – Optional list of files to attach

get_labels()[source]#

Returns the available labels on the GMail account