Send an Email.
Description
This event handler responds to events by sending one or more emails through a defined mail relay.
Configuration
This event handler has the following parameters:
- smartHost - the IP address or name of the host that will handle email for the WebBrick Gateway.
- smartPort - the TCP port on smartHost that listens for SMTP email, default 25.
The smartHost has to be accessible from the Gateway, a good choice would be your ISP's SMTP relay.
For each mapped event there can be one or more email elements, each email element defines and email message to be sent. Within this there must be four elements:
- to - addressee for email.
- from - sender for email.
- subject - subject line.
- body - message body.
Each of th above can substitute in values from the other data of the triggering event message, this is done by wrapping the name of the other data value in %()s, i.e. %(state)s, %(val)s, %(value)s. The other data may be from one of the system defined event types or your own event type created as newEvent in a handler such as EventMapper
Example
<eventInterface module='EventHandlers.EmailAction' name='EmailAction' smartHost='localhost' smartPort='25'>
<eventtype type="">
<eventsource source="webbrick/100/DO/0" >
<event>
<email>
<to>TestUser</to>
<from>TestUser</from>
<body>TestUser %(state)s</body>
<subject>TestUser %(state)s</subject>
</email>
</event>
</eventsource>
</eventtype>
</eventInterface>
