i'm new in wso2. used this code , sends email ok, how can modify body of email? esb sends emails subject, empty body , without attachments. have been looking information in wso2 documentation how set body of email, did not find nothing.
i tried use script mediator, in this sample gave me next exception:
caused by: org.mozilla.javascript.evaluatorexception: can't find method org.apache.synapse.mediators.bsf.scriptmessagecontext.setpayloadxml(). (<unknown source>#1) @ org.mozilla.javascript.defaulterrorreporter.runtimeerror(defaulterrorreporter.java:109) @ org.mozilla.javascript.context.reportruntimeerror(context.java:1030) @ org.mozilla.javascript.context.reportruntimeerror(context.java:1086) @ org.mozilla.javascript.context.reportruntimeerror1(context.java:1049) @ org.mozilla.javascript.nativejavamethod.call(nativejavamethod.java:162) @ org.mozilla.javascript.optimizer.optruntime.callprop0(optruntime.java:119) @ org.mozilla.javascript.gen.c4._c0(<unknown source>:1) @ org.mozilla.javascript.gen.c4.call(<unknown source>) @ org.mozilla.javascript.contextfactory.dotopcall(contextfactory.java:393) @ org.mozilla.javascript.scriptruntime.dotopcall(scriptruntime.java:2834) @ org.mozilla.javascript.gen.c4.call(<unknown source>) @ org.mozilla.javascript.gen.c4.exec(<unknown source>) @ com.sun.phobos.script.javascript.rhinocompiledscript.eval(rhinocompiledscript.java:55) ... 15 more i'm using wso2 4.7.0. can me? thanks.
in following proxy have parametrized body. it's working fine me
<?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="mailtotransportsenderbcc" transports="https,http" statistics="disable" trace="disable" startonload="true"> <target> <insequence> <property name="emailsubjecttosent" expression="//emailsubject" scope="default" type="string"/> <property name="emailmassegetosent" expression="//emailmassege" scope="default" type="string"/> <property name="subject" expression="get-property('emailsubjecttosent')" scope="transport"/> <property name="out_only" value="true" scope="default" type="string"/> <property name="contenttype" value="text/plain" scope="axis2"/> <property name="messagetype" value="text/plain" scope="axis2"/> <payloadfactory media-type="xml"> <format> <ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">$1</ns:text> </format> <args> <arg evaluator="xml" expression="get-property('emailmassegetosent')"/> </args> </payloadfactory> <send> <endpoint> <address uri="mailto:receiver@gmail.com"/> </endpoint> </send> <header name="to" action="remove"/> <property name="no_entity_body" scope="axis2" action="remove"/> <property name="response" value="true" scope="default" type="string"/> <send/> </insequence> <outsequence> <send/> </outsequence> </target> <description/> </proxy>
Comments
Post a Comment