Use the action field enums in mailgun (#195961)

This commit is contained in:
epenet
2026-12-02 09:11:43 +01:00
committed by GitHub
parent 871363811f
commit ea6578000f
+3 -4
View File
@@ -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: