home-assistant.io/source/_components/notify.mailgun.markdown
Alok Saboo 1aca7b08cf Misc fixes: e.g. -> e.g., and proper case for Home Assistant (#4942)
* e.g. to e.g., and proper case for Home Assistant

* Instructions how to -> Instructions on how to
2018-03-17 20:20:37 +01:00

1.8 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_release
layout title description date sidebar comments sharing footer logo ha_category ha_release
page Mailgun Notify Instructions on how to add Mailgun mail notifications to Home Assistant. 2017-02-06 16:52 true false true true mailgun.png Notifications 0.38

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

{% linkable_title Sample configuration %}

# Example configuration.yaml entry
mailgun:
  domain: mg.example.com
  api_key: token-XXXXXXXXX
  sandbox: False

notify:
  - name: mailgun
    platform: mailgun
    recipient: me@example.com

Configuration variables:

  • domain (Optional): This is the domain name to be used when sending out mail. Defaults to the first custom domain you have set up.
  • sandbox (Optional): Whether to use the sandboxed domain for outgoing mail. The domain item takes precedence over this. Defaults to False.
  • token (Required): This is the API token that has been generated in your Mailgun account.
  • recipient (Required): The email address of the recipient.
  • sender (Optional): The sender's email address. Defaults to hass@DOMAIN, where DOMAIN is outgoint mail domain, as defined by the domain and sanbox configuration entries.

{% linkable_title 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