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

send_email(from_address, to_addresses, subject, message)[source]

RPC Method allowing a platform to send an email address.

One can also send an email through the pubsub mechanism.

Parameters
  • from_address

  • to_addresses

  • subject

  • message

emailer.agent.main(argv=['/home/docs/checkouts/readthedocs.org/user_builds/volttron/envs/releases-8.1.1/lib/python3.6/site-packages/sphinx/__main__.py', '-T', '-E', '-b', 'html', '-d', '_build/doctrees', '-D', 'language=en', '.', '_build/html'])[source]

Main method called by the aip.