Mailgun Notify


The Mailgun notification service allows you to send emails via Mailgun’s REST API. It requires the Mailgun component to be set up.

Sample configuration

# Example configuration.yaml entry
mailgun:
  domain: EXAMPLE.COM
  api_key: YOUR_API_KEY

notify:
  - name: mailgun
    platform: mailgun
    recipient: CHANGE@EXAMPLE.COM

Configuration Variables

domain

(string)(Required)This is the domain name to be used when sending out mail.

sandbox

(boolean)(Optional)(Deprecated) If a sandboxed domain is used, specify it in domain.

Default value: false

api_key

(string)(Required)This is the API Key that has been generated in your Mailgun account.

recipient

(string)(Required)The email address of the recipient.

sender

(string)(Optional)The sender’s email address.

Default value: hass@DOMAIN, where DOMAIN is the outgoing mail domain, as defined by the domain configuration entry.

Example automation

The following automation reacts to an event by sending out an email with two attachments.

# Example automation using Mailgun notifications
automation:
  trigger:
    platform: event
    event_type: SPECIAL_EVENT
  action:
    service: notify.mailgun
    data:
      title: "Something special has happened"
      message: "This a test message from Home Assistant"
      data:
        images:
          - /home/pi/pic_test1.png
          - /home/pi/pic_test2.png