wso2 - How we can send body in wso2esb mail format -


i using mail transport , have done changes in axis2 file , esb ruining fine mail issue not sending properr format wish send body sending "subject" config this

<?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse"        name="staticmail"        transports="http"        startonload="true"        trace="disable">    <description/>    <target>       <insequence>          <property name="senderaddress"                    expression="//mail/text()"                    scope="default"/>          <property name="subject" value="alert:reading out of range" scope="transport"/>          <property name="message" value="response message" scope="transport"/>          <property name="body" expression="//list/text()" scope="default"/>          <header name="to"                  expression="fn:concat('mailto:', get-property('senderaddress'))"/>          <property name="out_only" value="true"/>          <log level="full">             <property name="message" value="response message"/>             <property name="sender address" expression="get-property('senderaddress')"/>          </log>          <send/>       </insequence>       <outsequence/>    </target> </proxy> 

but sending mail format only

alert:reading out of range subject there nobody mail , 1 empty attachment with"noname" how can send mail proper body please let me know

you can using script mediator sample here

here example sends error message email body , error code subject. here payload factory used instead of script mediator.

<faultsequence>      <property xmlns:ns="http://org.apache.synapse/xsd" name="errorcode" expression="get-property('error_code')" scope="default" type="integer"/>      <property name="errormessage" expression="get-property('error_message')" scope="default" type="string"/>               <property name="messagetype" value="text/html" scope="axis2"/>      <property name="contenttype" value="text/html" scope="axis2"/>      <property xmlns:ns="http://org.apache.synapse/xsd" name="subject" expression="$ctx:errorcode" scope="transport"/>      <payloadfactory>         <format>            <ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:text>         </format>         <args>            <arg expression="$ctx:errormessage"/>         </args>      </payloadfactory>      <property name="out_only" value="true"/>      <send>         <endpoint>            <address uri="mailto:youremail@gmail.com"/>         </endpoint>      </send>   </faultsequence> 

Comments