emailer.agent module¶
-
class
emailer.agent.
EmailerAgent
(config_path, **kwargs)[source]¶ Bases:
volttron.platform.vip.agent.Agent
-
configure_main
(config_name, action, contents)[source]¶ The main configuration callback.
- Parameters
config_name –
action –
contents –
-
on_alert_message
(peer, sender, bus, topic, headers, message)[source]¶ Callback for alert messages that come into the platform.
- Parameters
peer –
sender –
bus –
topic –
headers –
message –
-
on_email_message
(peer, sender, bus, topic, headers, message)[source]¶ Callback used for sending email messages through the pubsub bus.
Either the from_address and to_addresses can be ommitted if they are specified in the configuration store/file. If they are to be used the following block shows the format for usage.
{ "from-address": 'foo@bar.com', "to-addresses": ['alpha.beta@fo.com', 'bob-and-joe@bim.com'] }
** In the above code to-addresses can be a singe email address as well**
The message must be a dictionary containing a subject and a message. In addition, an optional to-addresses entry can be added for sending to a specific group of users.
{ "subject": "I am a happy camper", "message": "This is a big long string message that I am sending" -- OPTIONAL -- "to-addresses": ['yabba@daba.com'] }
- Parameters
peer –
sender –
bus –
topic –
headers –
message –
-