email

Email sending utilities

Configure email sending functionality by adding the following fields to your Pimlico local config file:

email_sender
From-address for all sent emails
email_recipients
To-addresses, separated by commas. All notification emails will be sent to all recipients
email_host
(optional) Hostname of your SMTP server. Defaults to localhost
email_username
(optional) Username to authenticate with your SMTP server. If not given, it is assumed that no authentication is required
email_password
(optional) Password to authenticate with your SMTP server. Must be supplied if username is given
class EmailConfig(sender=None, recipients=None, host=None, username=None, password=None)[source]

Bases: object

classmethod from_local_config(local_config)[source]
send_pimlico_email(subject, content, local_config, log)[source]

Primary method for sending emails from Pimlico. Tries to send an email with the given content, using the email details found in the local config. If something goes wrong, an error is logged on the given log.

Parameters:
  • subject – email subject
  • content – email text (may be unicode)
  • local_config – local config dictionary
  • log – logger to log errors to (and info if the sending works)
send_text_email(email_config, subject, content=None)[source]
exception EmailError[source]

Bases: Exception