Browse Source

明天开课,今天提醒,新邮件模板

lizhen_gitee 5 months ago
parent
commit
ca4666e49e
2 changed files with 56 additions and 2 deletions
  1. 38 0
      application/api/controller/Demo.php
  2. 18 2
      application/index/controller/Plantask.php

+ 38 - 0
application/api/controller/Demo.php

@@ -7,6 +7,7 @@ use Aws\Sns\SnsClient;
 use Aws\Exception\AwsException;
 use app\common\library\Getui;
 use think\Db;
+use app\common\library\Email;
 
 use getui\GTClient;
 use getui\GTPushRequest;
@@ -47,6 +48,43 @@ class Demo extends Api
         })
      */
 
+    public function auto_lesson_slot_notice(){
+        $order = [
+            'firstname' => '振',
+            'lastname' => '李',
+            'email' => '1129121659@qq.com',
+            'name_en' => '蹦极',
+        ];
+        $slot = [
+            'starttime' => time(),
+        ];
+
+        $message =
+            'Hi,'.$order['firstname']. ' ' .$order['lastname'].'!<br/>
+                    We are looking forward to seeing you at the following class tomorrow!<br/>
+                    Class:'.$order['name_en'].'<br/>
+                    Date: '.date('d F Y',$slot['starttime']).'<br/>
+                    Time: '.date('H:i a',$slot['starttime']).'<br/>
+                    Please arrive 10 minutes before the class timing to prepare for the harness fitting!<br/>
+                    We are located at 450 Alexandra Road, #02-01,<br/>
+                    Singapore 119960. For those who are driving, parking is available on level 2 of the building. For those who are taking public transport, the nearest mrt is Labrador Park MRT (7-10 minutes walk) and there is also a bus stop available just outside the building!<br/>
+                    We look forward to seeing you for an amazing session! ❤<br/>
+                    Best Regards,<br/>
+                    Elin Dance Studio<br/>
+                    <img src="'.config('website_url').'/assets/img/logo3.png" style="width:136px;height:115px">
+                    ';
+
+
+
+        $obj = new Email();
+        $result = $obj
+            ->to($order['email'])
+            ->subject('You have a class tomorrow!')
+            ->message($message)
+            ->send();
+        dump($result);
+    }
+
     public function hitpay_redirect_log(){
         $url = input('url','');
 

+ 18 - 2
application/index/controller/Plantask.php

@@ -53,10 +53,26 @@ class Plantask extends Controller
             try {
                 $obj = new Email();
                 foreach($order_list as $order){
+
+                    $message =
+                    'Hi,'.$order['firstname']. ' ' .$order['lastname'].'!<br/>
+                    We are looking forward to seeing you at the following class tomorrow!<br/>
+                    Class:'.$order['name_en'].'<br/>
+                    Date: '.date('D l Y',$slot['starttime']).'<br/>
+                    Time: '.date('H:i a',$slot['starttime']).'<br/>
+                    Please arrive 10 minutes before the class timing to prepare for the harness fitting!<br/>
+                    We are located at 450 Alexandra Road, #02-01,<br/>
+                    Singapore 119960. For those who are driving, parking is available on level 2 of the building. For those who are taking public transport, the nearest mrt is Labrador Park MRT (7-10 minutes walk) and there is also a bus stop available just outside the building!<br/>
+                    We look forward to seeing you for an amazing session! ❤<br/>
+                    Best Regards,<br/>
+                    Elin Dance Studio<br/>
+                    <img src="'.config('website_url').'/assets/img/logo3.png" style="width:100px;height:100px">
+                    ';
+
                     $result = $obj
                         ->to($order['email'])
-                        ->subject('Don’t forget about your class tomorrow!')
-                        ->message('Hi,'.$order['firstname']. ' ' .$order['lastname'].',您预约的['.$order['name'].']将于'.date('Y-m-d H:i',$slot['starttime']).'开课,请合理安排时间,准时来上课哦!')
+                        ->subject('You have a class tomorrow!')
+                        ->message($message)
                         ->send();
 
                     //发whatsapp