# Mail Server Integration
######################################################################
-- name: mail
+# Mail to Giorgio
+- name: mail_giorgio
platform: smtp
server: !secret mail_server
port: 25
encryption: none
sender: !secret mail_sender
- recipient: !secret mail_recipient
+ recipient: !secret mail_giorgio
+ sender_name: Casa Ravera-Testa
+
+# Mail to Laura
+- name: mail_laura
+ platform: smtp
+ server: !secret mail_server
+ port: 25
+ encryption: none
+ sender: !secret mail_sender
+ recipient: !secret mail_laura
+ sender_name: Casa Ravera-Testa
+
+# Mail to All
+- name: mail_all
+ platform: smtp
+ server: !secret mail_server
+ port: 25
+ encryption: none
+ sender: !secret mail_sender
+ recipient: !secret mail_all
sender_name: Casa Ravera-Testa
# Inputs:
# - title
# - message
+# - destination
# - notification_id
# - enable_persistent
# - enable_telegram
variables:
defaultTitle: 'Home Assistant'
defaultId: 'generic'
+ defaultDestination: 'giorgio'
title: >-
{# Check Null Input #}
{% if title | length == 0 %}
{% set title = defaultTitle %}
{% endif %}
{{ title }}
+ destination: >-
+ {# Check Null Input #}
+ {% if destination | length == 0 %}
+ {% set destination = defaultDestination %}
+ {% endif %}
+ {{ destination }}
notification_id: >-
{# Check Null Input #}
{% if notification_id | length == 0 %}
title:
description: "Titolo della notifica"
example: "Home Assistant"
+ default: "Home Assistant"
selector:
text:
message:
example: "Testo Messaggio"
selector:
text:
+ destination:
+ description: "A chi inviare la notifica"
+ example: "giorgio"
+ default: "giorgio"
+ selector:
+ select:
+ options:
+ - "giorgio"
+ - "laura"
+ - "all"
notification_id:
description: "Id di notifica"
example: "generic"
+ default: "generic"
selector:
text:
enable_persistent:
entity_id: input_boolean.text_notifications
state: 'on'
- - action: notify.mail
+ - service: >
+ {% if destination == 'giorgio' %}
+ notify.mail_giorgio
+ {% elif destination == 'laura' %}
+ notify.mail_laura
+ {% else %}
+ notify.mail_all
+ {% endif %}
data_template:
title: "{{ title }}"
message: "{{ message }}"
# - message
# - media_player
# - volume_level
-# _ language
+# - language
+# - destination
# - notification_id
# - enable_persistent
# - enable_telegram
defaultTitle: 'Home Assistant'
defaulMediaPlayer: 'media_player.google_home'
defaultVolume: 0.35
+ defaultDestination: 'giorgio'
defaultId: 'generic'
title: >-
{# Check Null Input #}
{% set language = 'it' %}
{% endif %}
{{ language }}
+ destination: >-
+ {# Check Null Input #}
+ {% if destination | length == 0 %}
+ {% set destination = defaultDestination %}
+ {% endif %}
+ {{ destination }}
notification_id: >-
{# Check Null Input #}
{% if notification_id | length == 0 %}
title:
description: "Titolo della notifica"
example: "Home Assistant"
+ default: "Home Assistant"
selector:
text:
message:
media_player:
description: "Destinazione della notifica"
example: "media_player.google_home"
+ default: "media_player.google_home"
selector:
entity:
domain: media_player
+ destination:
+ description: "A chi inviare la notifica"
+ example: "giorgio"
+ default: "giorgio"
+ selector:
+ select:
+ options:
+ - "giorgio"
+ - "laura"
+ - "all"
volume_level:
description: "Livello del volume"
example: "0.35"
notification_id:
description: "Id di notifica"
example: "generic"
+ default: "generic"
selector:
text:
enable_persistent:
data_template:
title: "{{ title }}"
message: "{{ message }}"
+ destination: "{{ destination }}"
notification_id: "{{ notification_id }}"
enable_persistent: "{{ enable_persistent }}"
enable_telegram: "{{ enable_telegram }}"