|
@@ -268,7 +268,38 @@ class Lessonslot extends Backend
|
|
|
|
|
|
Db::commit();
|
|
|
|
|
|
- //发送通知给用户
|
|
|
+ //额外的通知
|
|
|
+ $userinfo = Db::name('user')->where('id',$user_id)->find();
|
|
|
+ $obj = new Email();
|
|
|
+ try {
|
|
|
+ //给这些用户发邮件
|
|
|
+ $result = $obj
|
|
|
+ ->to($userinfo['email'])
|
|
|
+ ->subject('Elin Dance Studio 已帮您预约课程')
|
|
|
+ ->message('Hi,'.$userinfo['firstname']. ' ' .$userinfo['lastname'].',已帮您预约课程['.$info['name_en'].'],上课时间:'.date('Y-m-d H:i',$info['starttime']).',请及时来上课!')
|
|
|
+ ->send();
|
|
|
+
|
|
|
+ //发whatsapp
|
|
|
+ $parameters = [
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => $userinfo['firstname'].' '.$userinfo['lastname'],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => $info['name_en'],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'type' => 'text',
|
|
|
+ 'text' => date('Y-m-d H:i',$info['starttime']),
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ $this->whatapp($userinfo['whatsapp'],'lessonorder_alternate_to_booking','en_US',$parameters);
|
|
|
+
|
|
|
+ } catch (Exception $e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ //额外的通知
|
|
|
|
|
|
$this->success('预约成功');
|
|
|
}
|