emails

Functions

intranet.apps.notifications.emails.email_send(text_template: str, html_template: str, data: Mapping[str, object], subject: str, emails: Collection[str], headers: Mapping[str, str] | None = None, bcc: bool = False, *, custom_logger: Logger | None = None) EmailMultiAlternatives[source]

Send an HTML/Plaintext email with the following fields. If we are not in production and settings.FORCE_EMAIL_SEND is not set, does not actually send the email

Parameters:
  • text_template – URL to a Django template for the text email’s contents

  • html_template – URL to a Django template for the HTML email’s contents

  • data – The context to pass to the templates

  • subject – The subject of the email

  • emails – The addresses to send the email to

  • headers – A dict of additional headers to send to the message

  • custom_logger – An optional logger to use instead of the Django logger

Returns:

The email object that was created (and sent if we’re in production or settings.FORCE_EMAIL_SEND is set)