From 7b93fd2d99483c8dffa9ebde5ca822bd22b4cb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20L=27hopital?= Date: Wed, 29 Jul 2020 14:18:36 +0200 Subject: [PATCH] [mail] documentation enhancement. (#8177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gaƫl L'hopital --- bundles/org.openhab.binding.mail/README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bundles/org.openhab.binding.mail/README.md b/bundles/org.openhab.binding.mail/README.md index ce9fc9f801f37..ecf4df47661fe 100644 --- a/bundles/org.openhab.binding.mail/README.md +++ b/bundles/org.openhab.binding.mail/README.md @@ -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 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 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 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 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 (`mail@example.com`) or a list of addresses, concatenated by a comma (`mail@example.com, mail2@example.com`). Since there is a separate rule action instance for each `smtp` thing, this needs to be retrieved through `getActions(scope, thingUID)`. @@ -111,8 +113,8 @@ Examples: ``` val mailActions = getActions("mail","mail:smtp:samplesmtp") -mailActions.sendMail("mail@example.com", "Test subject", "This is the mail content.") -mailActions.sendMail("mail1@example.com, mail2@example.com", "Test subject", "This is the mail content sent to multiple recipients.") +val success = mailActions.sendMail("mail@example.com", "Test subject", "This is the mail content.") +success = mailActions.sendMail("mail1@example.com, mail2@example.com", "Test subject", "This is the mail content sent to multiple recipients.") ```