Email notification

Hi, i want to create an automation that sends me a notification (via tts google cloud service) every time i get an email from a specific sender. I created an automation that should work fine, but it doesn’t recieve the mail. The imap provided sensor does notice that i got an unread mail but it feels like that the “imap_contet” is empty or can not be checked, here is my automation:

- id: '1716306415346'

alias: Notify on specific email

trigger:

- platform: event

event_type: imap_content

event_data:

username: [email protected]

sender: [email protected]

initial: true

action:

- service: tts.cloud_say

data:

cache: false

entity_id: media_player.kuche

message: Du hast eine Mail bekommen

i presume your indentation as posted here is not what’s actually in your yaml? when you post yaml here please preserve the indentiation since indentation is meaningful in yaml.

in terms of your actual yaml, why do you have username in the trigger? that’s your receiving imap user name. if you just use sender, does it trigger?

also are you confident you have the integration set up properly? you’ve been able to validate that?

The imap_content event is not exclusive to a single account. OP may have IMAP sensors for multiple emails accounts but only want those to a certain account to trigger the automation.

yup, but since he had same address for username and sender, was wondering if it was erroneously using as sender…

maybe the right question should have been:
“username” is your receiving account right? not the same as sender… and if you only have 1 configured imap account, you can nuke it altogether…