The latest version for DAS is WSO2 Data Analytics Server 3.2.0. View documentation for the latest release.
WSO2 Data Analytics Server is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.
||
Skip to end of metadata
Go to start of metadata

Email event publisher is used to publish events in XML, JSON or text formats via email transports.

Prerequisites

Follow the steps below to complete the prerequisites before starting the event publisher configurations.

Edit the email address, username, password and other relevant properties in the <PRODUCT_HOME>/repository/conf/output-event-adapters.xml file, to point the mail transport sender which is  enabled by default in the product, to a valid SMTP configuration as shown in the example below.

<adapterConfig type="email">
    <property key="mail.smtp.from">email-address</property>
    <property key="mail.smtp.user">user-name</property>
    <property key="mail.smtp.password">password</property>
    <property key="mail.smtp.host">smtp.gmail.com</property>
    <property key="mail.smtp.port">587</property>
    <property key="mail.smtp.starttls.enable">true</property>
    <property key="mail.smtp.auth">true</property>
    <!-- Thread Pool Related Properties -->
    <property key="maxThread">100</property>
    <property key="keepAliveTimeInMillis">20000</property>
    <property key="jobQueueSize">10000</property>
</adapterConfig>

Creating an email event publisher

For instructions on creating an email event publisher, see Creating Alerts.

Configuring adapter properties

Specify the Dynamic Adapter Properties, when creating an email event publisher using the management console as shown below.

email event publisher

After entering the above adapter properties, select  the  Message Format   which you want to apply on the published events . Also, click  Advanced  to define custom output mappings based on the  Message Format  you selected. For more information on custom output mapping types, see Output Mapping Types.

 

You can also d efine the respective adapter properties of the event publisher based on the transport type within the  <to>  element of the event publisher configuration in the <PRODUCT_HOME>/repository/deployment/server/eventpublishers/ directory as follows.

 

<eventPublisher name="EmailOuputEventAdapter" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
 ...................
  <to eventAdapterType="email">
    <property name="email.address">[email protected]</property>
    <property name="email.type">text/plain</property>
    <property name="email.subject">This is a test mail.</property>
  </to>
</eventPublisher>
The above adapter properties are described below.
Adapter Property
Description
Configuration file propertyExample
Email Address Email address of the client. Register the publisher for multiple email IDs' by separating them with commas.
email.address

[email protected]

Subject Subject of the email to be sent to the defined email address.
email.subject

This is a test mail.

Email Type

The email format to be sent to the defined email address.

 

If you select text/html for this parameter, the message body should be in valid HTML.


email.type
text/plain

Related samples

For more information on email event publisher type, see the following sample in WSO2 CEP Documentation.

  • No labels
  • Download PDF icon Download PDF
  • Download a PDF file of the documentation