I have a smtp email notify sent up that I use for a lot of different email alerts. Rather than making a different notify for each type is there a way to set the sender_name in a script?
For example right now I use this generic smtp notify:
- name: "gmail_smtp_email"
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender_name: "Home Assistant Notification"
sender: !secret emailFrom
encryption: starttls
username: !secret emailUser
password: !secret emailPwd
recipient:
- !secret emailTo
Rather than setting the sender_name: “Home Assistant Notification” here could I set it in the script that calls this “notify”?
For instance is there any way to add the sender_name here? Everything I’ve tried throws an error.
frontdoor_camera_motion_email:
alias: frontdoor_camera_motion_email
sequence:
- service: notify.gmail_smtp_email
data:
message: ''
title: Person has been detected at the front door {{ now().strftime("%-m.%-d.%Y
%-I:%M:%S %p") }}
data:
images:
- /config/www/tmp/FrontdoorCameraMotionTrigger.jpg
mode: single
icon: mdi:email-alert-outline
All of my HA notifications go into one folder in my email. It would be really helpful to quickly see which type of notification email it is without actually looking at the email.