ki
name: "Send an email"
description: "Send an email"
version: "1"
on
ogit/_id
when
ShouldSendEmail=="true"
do
exec: LOCAL::RESULT,
stdout: LOCAL::OUTPUT,
stderr: LOCAL::ERROR,
exit: LOCAL::SYSTEMRC = action(
capability: "SendEmail",
from: "user@example.com",
to: "user@example.com",
subject: "Hello",
body: "Hey dear customer! Click <a href=\"http://example.com\">this link</a>",
type: "html")
log.info(LOCAL::RESULT)
log.info(LOCAL::OUTPUT)
log.error(LOCAL::ERROR)
log.info(LOCAL::SYSTEMRC)
delete(ShouldSendEmail)
Table of Contents
Introduction
The SendEmail capability is designed to send either a HTML or Plain email to one or more pre-defined recipients.
Example usage
-
The
capabilityshould be set toSendEmail -
The
fromemail address needs to be authorised on the SMTP server with the SMTP credentials provided. -
The
tois the recipient email address.ccandbcccan also be provided -
The
bodyis the email content, and can be Plain or HTML -
The
typeshould be set toplainorhtmldepending on the email body content