diff --git a/homeassistant/components/mailgun/notify.py b/homeassistant/components/mailgun/notify.py index 2cf5b36ed47d..7a05a6a46071 100644 --- a/homeassistant/components/mailgun/notify.py +++ b/homeassistant/components/mailgun/notify.py @@ -12,11 +12,10 @@ from pymailgunner import ( ) from homeassistant.components.notify import ( - ATTR_DATA, - ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA as NOTIFY_PLATFORM_SCHEMA, BaseNotificationService, + NotifyServiceArgument, ) from homeassistant.const import CONF_API_KEY, CONF_DOMAIN, CONF_RECIPIENT, CONF_SENDER from homeassistant.core import HomeAssistant @@ -99,8 +98,8 @@ class MailgunNotificationService(BaseNotificationService): def send_message(self, message: str = "", **kwargs: Any) -> None: """Send a mail to the recipient.""" - subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT) - data = kwargs.get(ATTR_DATA) + subject = kwargs.get(NotifyServiceArgument.TITLE, ATTR_TITLE_DEFAULT) + data = kwargs.get(NotifyServiceArgument.DATA) files = data.get(ATTR_IMAGES) if data else None try: