Skip to content

Commit

Permalink
[mail] documentation enhancement. (openhab#8177)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaël L'hopital <[email protected]>
  • Loading branch information
clinique authored and markus7017 committed Sep 18, 2020
1 parent 2b21016 commit 7b93fd2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions bundles/org.openhab.binding.mail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@ sitemap demo label="Main Menu"
This binding includes rule actions for sending email.
Six different actions available:

* `sendMail(String recipient, String subject, String text)`
* `sendMail(String recipient, String subject, String text, String URL)`
* `sendMail(String recipient, String subject, String text, List<String> URL)`
* `sendHtmlMail(String recipient, String subject, String htmlContent)`
* `sendHtmlMail(String recipient, String subject, String htmlContent, String URL)`
* `sendHtmlMail(String recipient, String subject, String htmlContent, List<String> URL)`
* `boolean success = sendMail(String recipient, String subject, String text)`
* `boolean success = sendMail(String recipient, String subject, String text, String URL)`
* `boolean success = sendMail(String recipient, String subject, String text, List<String> URL)`
* `boolean success = sendHtmlMail(String recipient, String subject, String htmlContent)`
* `boolean success = sendHtmlMail(String recipient, String subject, String htmlContent, String URL)`
* `boolean success = sendHtmlMail(String recipient, String subject, String htmlContent, List<String> URL)`

The `sendMail(...)` send a plain text mail (with attachments if supplied).
The `sendHtmlMail(...)` send a HTML mail (with attachments if supplied).

Both functions return a boolean as the result of the operation.

`recipient` can be a single address (`[email protected]`) or a list of addresses, concatenated by a comma (`[email protected], [email protected]`).

Since there is a separate rule action instance for each `smtp` thing, this needs to be retrieved through `getActions(scope, thingUID)`.
Expand All @@ -111,8 +113,8 @@ Examples:

```
val mailActions = getActions("mail","mail:smtp:samplesmtp")
mailActions.sendMail("[email protected]", "Test subject", "This is the mail content.")
mailActions.sendMail("[email protected], [email protected]", "Test subject", "This is the mail content sent to multiple recipients.")
val success = mailActions.sendMail("[email protected]", "Test subject", "This is the mail content.")
success = mailActions.sendMail("[email protected], [email protected]", "Test subject", "This is the mail content sent to multiple recipients.")
```

Expand Down

0 comments on commit 7b93fd2

Please sign in to comment.