SMTP: Add documentation for notification service call (#18038)

This commit is contained in:
billsq 2021-06-28 03:54:20 -07:00 committed by GitHub
parent 9ba43b8cc7
commit 6d95f0e840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ sender:
required: true
type: string
recipient:
description: E-mail address of the recipient of the notification. This can be a recipient address or a list of addresses for multiple recipients.
description: Default E-mail address of the recipient of the notification. This can be a recipient address or a list of addresses for multiple recipients.<br>This is where you want to send your E-mail notifications by default (when not specifying `target` in the service call). Any E-mail address(es) specified in the service call's `target` field will override this recipient content.
required: true
type: [list, string]
server:
@ -85,16 +85,16 @@ A sample configuration entry for Google Mail.
notify:
- name: "NOTIFIER_NAME"
platform: smtp
server: "smtp.gmail.com"
server: "smtp.example.com"
port: 587
timeout: 15
sender: "john@gmail.com"
sender: "john@example.com"
encryption: starttls
username: "john@gmail.com"
username: "john@example.com"
password: "thePassword"
recipient:
- "james@gmail.com"
- "bob@gmail.com"
- "james@example.com"
- "bob@example.com"
sender_name: "My Home Assistant"
```
@ -113,12 +113,16 @@ burglar:
data:
title: "Intruder alert"
message: "Intruder alert at apartment!!"
target:
- "my_intruder_alert@example.com"
data:
images:
- /home/pi/snapshot1.jpg
- /home/pi/snapshot2.jpg
```
The optional `target` field is used to specify recipient(s) for this specific service call. When `target` field is not used, this message will be sent to default recipient(s), in this example, james@example.com and bob@example.com.
The optional `images` field adds in-line image attachments to the email. This sends a text/HTML multi-part message instead of the plain text default.
The optional `html` field makes a custom text/HTML multi-part message, allowing total freedom for sending rich html emails. In them, if you need to attach images, you can pass both arguments (`html` and `images`), the attachments will be joined with the basename of the images, so they can be included in the html page with `src="cid:image_name.ext"`.