mailgun#

class platypush.plugins.mailgun.MailgunPlugin(api_key: str, api_base_url: str = 'https://api.mailgun.net/v3', **kwargs)[source]#

Bases: MailOutPlugin

Mailgun integration.

__init__(api_key: str, api_base_url: str = 'https://api.mailgun.net/v3', **kwargs)[source]#
Parameters:
  • api_key – Mailgun API secret key.

  • api_base_url – Use https://api.eu.mailgun.net/v3 if you are using an EU account.

send(domain: str, to: str | Sequence[str], from_: str | None = None, cc: str | Sequence[str] | None = None, bcc: str | Sequence[str] | None = None, subject: str = '', body: str = '', body_type: str = 'plain', attachments: Sequence[str] | None = None, **kwargs)[source]#

Send an email through Mailgun.

Parameters:
  • domain – From which registered domain the email(s) should be sent.

  • to – Receiver(s), as comma-separated strings or list.

  • from – Sender email address (from is also supported outside of Python contexts).

  • cc – Carbon-copy addresses, as comma-separated strings or list

  • bcc – Blind carbon-copy addresses, as comma-separated strings or list

  • subject – Mail subject.

  • body – Mail body.

  • body_type – Mail body type - text or html.

  • attachments – List of attachment files to send.