mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Fix body text of imap message not available in custom event data template (#139609)
This commit is contained in:
parent
3690e03951
commit
6abdb28a03
@ -280,7 +280,7 @@ class ImapDataUpdateCoordinator(DataUpdateCoordinator[int | None]):
|
||||
if self.custom_event_template is not None:
|
||||
try:
|
||||
data["custom"] = self.custom_event_template.async_render(
|
||||
data, parse_result=True
|
||||
data | {"text": message.text}, parse_result=True
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"IMAP custom template (%s) for msguid %s (%s) rendered to: %s, initial: %s",
|
||||
|
@ -726,9 +726,10 @@ async def test_message_data(
|
||||
[
|
||||
("{{ subject }}", "Test subject", None),
|
||||
('{{ "@example.com" in sender }}', True, None),
|
||||
('{{ "body" in text }}', True, None),
|
||||
("{% bad template }}", None, "Error rendering IMAP custom template"),
|
||||
],
|
||||
ids=["subject_test", "sender_filter", "template_error"],
|
||||
ids=["subject_test", "sender_filter", "body_filter", "template_error"],
|
||||
)
|
||||
async def test_custom_template(
|
||||
hass: HomeAssistant,
|
||||
|
Loading…
x
Reference in New Issue
Block a user