hal.internet.email package

Submodules

hal.internet.email.gmail module

Use GMail APIs from python

class hal.internet.email.gmail.GMailApiOAuth(app_name, client_secrets_file, oauth_path)[source]

Bases: hal.internet.services.google.gauthenticator.GoogleApiOAuth

Creates OAuth driver for GMail

create_driver()[source]

Creates GMail driver

Returns:GMail API driver
hal.internet.email.gmail.get_mime_message(subject, text)[source]

Creates MIME message

Parameters:
  • subject – Subject of email
  • text – Email content
Returns:

Email formatted as HTML ready to be sent

hal.internet.email.gmail.send_email(sender, msg, driver)[source]

Sends email to me with this message

Parameters:
  • sender – Sender of email
  • msg – Message to send to me
  • driver – GMail authenticator

hal.internet.email.templates module

Email templates

class hal.internet.email.templates.EmailTemplate(recipient, subject, content_file, footer_file, extra_args=None)[source]

Bases: object

Default email template

Gets email footer

Returns:Email text (html formatted)
get_email_header()[source]

Gets email header

Returns:Email header
get_mime_message()[source]

Gets email MIME message

Returns:Email formatted as HTML ready to be sent

hal.internet.email.utils module

Email creator utils

hal.internet.email.utils.get_email_content(file_path)[source]

Email content in file

Parameters:file_path – Path to file with email text
Returns:Email text (html formatted)