Skip to content

MP_发送模板消息

Binary Wang edited this page Dec 5, 2017 · 11 revisions
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
.toUser(...)
.templateId(...)
.url(...)
.build();

templateMessage.getData().add(new WxMpTemplateData(name1, value1, color2));
templateMessage.getData().add(new WxMpTemplateData(name2, value2, color2));

wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);

更详细的使用方法请参考单元测试代码: /weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpTemplateMsgServiceImplTest.java

或者参考在线的javadoc: https://binarywang.github.io/weixin-java-mp-javadoc/me/chanjar/weixin/mp/api/impl/WxMpTemplateMsgServiceImpl.html

Clone this wiki locally