【发布时间】:2019-01-01 02:02:35
【问题描述】:
我想从 JMS JSON 消息中使用 wso2 4.9.0 发送适当的完全动态(收件人、发件人、正文、主题)html 电子邮件。
这是我想要的 SMTP 交换,所有值都来自 json 消息:
From: foo <noreply@bar>
Reply-To: foo <noreply@bar>
To: foobar@bar
Cc: bar@bar
Subject: =?UTF8?Q?test;_eacute:_=C3=A9?=
MIME-Version: 1.0
Content-Type: text/html; charset=UTF8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html><html><body>Hello =C3=A9<br> and a=
long line is split before 76 chars</body></html>
我试过(为了清楚起见缩写):
mc.setPayloadXML(<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">{message}</ns:text>);
// Almost OK but with 4.9.0, the PlainTextFormatter forces the Content-Type to text/plain (I think this is solved in wso2esb 5+)
我也试过了:
//Using in axis2.xml : <messageFormatter contentType="text/html" class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
mc.setPayloadXML(<html><body>{message}</body></html>)
// Not ok: Escapes the message
// if it didn't escape the message, it would result in invalid xml anyway
我还尝试了十几种其他组合,但都没有奏效。
是否可以接收 JSON JMS 消息,对其进行解析并从值发送正确的 html 电子邮件?
【问题讨论】:
标签: json email wso2 jms wso2esb