Send out emails using the Mandrill API.
In the minion configuration file, the following block is required:
mandrill:
key: <API_KEY>
New in version 2018.3.0.
salt.modules.mandrill.
send
(message, asynchronous=False, ip_pool=None, send_at=None, api_url=None, api_version=None, api_key=None, **kwargs)¶Send out the email using the details from the message
argument.
False
YYYY-MM-DD HH:MM:SS
format. If you specify a time in the past,
the message will be sent immediately. An additional fee applies for
scheduled email, and this feature is only available to accounts with a
positive balance.Note
Fur further details please consult the API documentation.
CLI Example:
$ salt '*' mandrill.send message="{'subject': 'Hi', 'from_email': 'test@example.com', 'to': [{'email': 'recv@example.com', 'type': 'to'}]}"
message
structure example (as YAML for readability):
message:
text: |
This is the body of the email.
This is the second line.
subject: Email subject
from_name: Test At Example Dot Com
from_email: test@example.com
to:
- email: recv@example.com
type: to
name: Recv At Example Dot Com
- email: cc@example.com
type: cc
name: CC At Example Dot Com
important: true
track_clicks: true
track_opens: true
attachments:
- type: text/x-yaml
name: yaml_file.yml
content: aV9hbV9zdXBlcl9jdXJpb3VzOiB0cnVl
Output example:
minion:
----------
comment:
out:
|_
----------
_id:
c4353540a3c123eca112bbdd704ab6
email:
recv@example.com
reject_reason:
None
status:
sent
result:
True