snoozingmail.gmail package¶
Submodules¶
snoozingmail.gmail.creds module¶
snoozingmail.gmail.modify module¶
-
snoozingmail.gmail.modify.ModifyMessage(service, msg_id, msg_labels)[source]¶ Modify the Labels on the given Message.
Parameters: - service – Authorized Gmail API service instance.
- msg_id – The id of the message required.
- msg_labels – A dictionary indicating the change in labels.
Returns: Modified message, containing updated labelIds, id and threadId.
snoozingmail.gmail.read module¶
-
snoozingmail.gmail.read.GetMimeMessage(service, msg_id)[source]¶ Get a Message and use it to create a MIME Message.
Parameters: - service – Authorized Gmail API service instance.
- msg_id – The ID of the Message required.
Returns: A MIME Message, consisting of data from Message.
-
snoozingmail.gmail.read.ListMessagesMatchingQuery(service, query='')[source]¶ List all Messages of the user’s mailbox matching the query.
Parameters: - service – Authorized Gmail API service instance.
- query – String used to filter messages returned.
- 'from (Eg.-) – user@some_domain.com’ for Messages from a particular sender.
Returns: List of Messages that match the criteria of the query. Note that the returned list contains Message IDs, you must use get with the appropriate ID to get the details of a Message.
-
snoozingmail.gmail.read.ListMessagesWithLabels(service, label_ids=[])[source]¶ List all Messages of the user’s mailbox with label_ids applied.
Parameters: - service – Authorized Gmail API service instance.
- label_ids – Only return Messages with these labelIds applied.
Returns: List of Messages that have all required Labels applied. Note that the returned list contains Message IDs, you must use get with the appropriate id to get the details of a Message.
snoozingmail.gmail.send module¶
-
snoozingmail.gmail.send.CreateMessage(to, subject, message_body, html=False, attachments=[])[source]¶ Create a message for an email.
Parameters: - to – Email address of the receiver.
- subject – The subject of the email message.
- message_body – The content of the email message.
- html – Whether the mesage_body is formatted as html
- attachments – List of file paths to files that should be attached to the email
Returns: An object containing a base64 encoded email object.