简体   繁体   中英

Email feature in WSO2 BPS

I have developed the Human Task using WSO2 BPS, now I would to have email notification to managers user when he has new task to proceed (approve or decline). Could you please advise me how to configure email sending in WSO2 BPS.

Thank you so much

Regards, Trong

Please refer bps documentation to setup email configurations to the human task.

Follow below steps to Configure email settings

  • Go to BPS_HOME/repository/conf/axis2
  • Open axis2-client.xml and add below configuration (Change relevant paramaters according to your email details)

    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">

    <parameter name="mail.smtp.from">bpsuser@gmail.com</parameter>

    <parameter name="mail.smtp.user">bpsuser</parameter>

    <parameter name="mail.smtp.password">bpsuserpassword</parameter>

    <parameter name="mail.smtp.host">smtp.gmail.com</parameter>

    <parameter name="mail.smtp.port">587</parameter>

    <parameter name="mail.smtp.starttls.enable">true</parameter>

    <parameter name="mail.smtp.auth">true</parameter>

    </transportSender>

  • Then go to <BPS_HOME>/repository/conf/humantask.xml file and change below property

<EnableEMailNotification>true</EnableEMailNotification>

To configure email message content follow below steps.

  • Define the email message settings inside the .ht file. (The .ht file can be accessed by unzipping the .zip file found in the <BPS_HOME>/repository/samples/humantask directory)

  • Add below configuration and change the content accordingly

    <htd:renderings> <htd:rendering type="wso2:email"> <wso2:to name="to" type="xsd:string">bpsuser@gmail.com</wso2:to> <wso2:subject name="subject" type="xsd:string">Email Subject</wso2:subject> <wso2:body name="body" type="xsd:string">Your message goes here</wso2:body> </htd:rendering> </htd:renderings>

  • At the top of the .ht filw add the name space as wso2 xmlns:wso2=" http://wso2.org/ht/schema/renderings/ "

Then save the changes and restart your server

WSO2 products support for sending mail using axis2 email transport. Therefore you may need to enable the mail transport in the axis2.xml file by defining the mail server and so on. If you just check by default, there configuration are commented. But there may be some component that uses this transport and send the email.. I am not sure how to send it with the Human Task using some configuration... But if there is no change config.. You can create axis2 service that supports for email sending and call that using your Human task. Please read this SO question for more details and this blog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM