content = $content; $this->orderConfig = $orderConfig; } // 定义直接使用内容发送平台的内容 public function getContent(GatewayInterface $gateway = null) { return sprintf('您的预售订单编号%s,已支付定金成功,今天%s到达支付尾款日期', $this->content['order_no'], $this->content['date']); } // 定义使用模板发送方式平台所需要的模板 ID public function getTemplate(GatewayInterface $gateway = null) { return $this->orderConfig['template_id']; } // 模板参数 public function getData(GatewayInterface $gateway = null) { return [ $this->orderConfig['template_variable'] => $this->content ]; } }