public function __construct($ToUserName, $FromUserName, $Title, $Description, $MusicUrl, $HQMusicUrl, $ThumbMediaId, $FuncFlag = 0) { parent::__construct($ToUserName, $FromUserName, $FuncFlag); $this->MsgType = 'music'; $this->Title = $Title; $this->Description = $Description; $this->MusicUrl = $MusicUrl; $this->HQMusicUrl = $HQMusicUrl; $this->ThumbMediaId = $ThumbMediaId; $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Music> <Title><![CDATA[%s]]></Title> <Description><![CDATA[%s]]></Description> <MusicUrl><![CDATA[%s]]></MusicUrl> <HQMusicUrl><![CDATA[%s]]></HQMusicUrl> <ThumbMediaId><![CDATA[%s]]></ThumbMediaId> </Music> <FuncFlag>%s</FuncFlag> </xml> XML; }
public function __construct($ToUserName, $FromUserName, $KfAccount = null) { parent::__construct($ToUserName, $FromUserName, 0); $this->MsgType = 'transfer_customer_service'; $this->KfAccount = $KfAccount; if (empty($this->KfAccount)) { $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> </xml> XML; } else { $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <TransInfo> <KfAccount>%s</KfAccount> </TransInfo> </xml> XML; } }
public function __construct($ToUserName, $FromUserName, $Content, $FuncFlag = 0) { parent::__construct($ToUserName, $FromUserName, $FuncFlag); $this->Content = $Content; $this->MsgType = 'text'; $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Content><![CDATA[%s]]></Content> <FuncFlag>%s</FuncFlag> </xml> XML; }
public function __construct($ToUserName, $FromUserName, $MediaId, $FuncFlag = 0) { parent::__construct($ToUserName, $FromUserName, $FuncFlag); $this->MsgType = 'image'; $this->MediaId = $MediaId; $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Image> <MediaId><![CDATA[%s]]></MediaId> </Image> <FuncFlag>%s</FuncFlag> </xml> XML; }
public function __construct($ToUserName, $FromUserName, $Articles, $FuncFlag = 0) { parent::__construct($ToUserName, $FromUserName, $FuncFlag); $this->MsgType = 'news'; $this->Articles = $Articles; $this->ArticleCount = min(self::MAX_ARTICLE_COUNT, count($this->Articles)); $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <ArticleCount>%d</ArticleCount> <Articles> %s </Articles> <FuncFlag>%s</FuncFlag> </xml> XML; }
public function __construct($ToUserName, $FromUserName, $MediaId, $Title, $Description, $FuncFlag = 0) { parent::__construct($ToUserName, $FromUserName, $FuncFlag); $this->MsgType = 'video'; $this->MediaId = $MediaId; $this->Title = $Title; $this->Description = $Description; $this->template = <<<XML <xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Video> <MediaId><![CDATA[%s]]></MediaId> <Title><![CDATA[%s]]></Title> <Description><![CDATA[%s]]></Description> </Video> <FuncFlag>%s</FuncFlag> </xml> XML; }