ex_wechat v0.1.8 Wechat.Message.XmlMessage
Module to deal with xml message.
Summary
Functions
Generate message for wechat. You can find what you need for generate message from the template file.
build(fromusername: "userid", tousername: "server_app_id",
msgtype: "text", content: "Hello World!"})
will generate:
<xml>
<ToUserName><![CDATA[userid]]></ToUserName>
<FromUserName><![CDATA[server_app_id]]></FromUserName>
<CreateTime>1478449547</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[Hello World!]]></Content> </xml>
This method will automaticlly check the msgtype
,
and choose the right template to render message.
Get xml data from Plug.Conn
ant then parse xml wechat message to Map.
You can get this message by use:
conn.assigns[:message]