Browse Source

套餐还有一个月提醒,新邮件模板

lizhen_gitee 5 months ago
parent
commit
385d0b757d
2 changed files with 48 additions and 2 deletions
  1. 33 0
      application/api/controller/Demo.php
  2. 15 2
      application/index/controller/Plantask.php

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

@@ -84,6 +84,39 @@ class Demo extends Api
             ->send();
         dump($result);
     }
+    public function auto_package_order_notice_mon(){
+        $order = [
+            'firstname' => '振',
+            'lastname' => '李',
+            'email' => '1129121659@qq.com',
+            'name_en' => '蹦极100节',
+            'endtime' => time(),
+        ];
+        $slot = [
+            'endtime' => time(),
+        ];
+
+        $message =
+            'Hi,'.$order['firstname']. ' ' .$order['lastname'].'!<br/>
+                    We wanted to let you know that the following plan is set to expire in one month’s time!<br/>
+                    Plan: '.$order['name_en'].'<br/>
+                    Expiry Date: '.date('d F Y',$order['endtime']).'<br/>
+                    Please note that any unutilised hours will automatically be forfeited in the system. Book your next session now and continue working towards those amazing goals you have set for yourself!<br/>
+                    If you would like to sign up for another plan, you can contact us at 8879-9689 or check on the app!❤<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('Your Membership Plan is Expiring in One Month’s Time!')
+            ->message($message)
+            ->send();
+        dump($result);
+    }
 
     public function hitpay_redirect_log(){
         $url = input('url','');

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

@@ -275,11 +275,24 @@ class Plantask extends Controller
         $obj = new Email();
         foreach($task_list as $order){
             try {
+
+                $message =
+                    'Hi,'.$order['firstname']. ' ' .$order['lastname'].'!<br/>
+                    We wanted to let you know that the following plan is set to expire in one month’s time!<br/>
+                    Plan: '.$order['name_en'].'<br/>
+                    Expiry Date: '.date('d F Y',$order['endtime']).'<br/>
+                    Please note that any unutilised hours will automatically be forfeited in the system. Book your next session now and continue working towards those amazing goals you have set for yourself!<br/>
+                    If you would like to sign up for another plan, you can contact us at 8879-9689 or check on the app!❤<br/>
+                    Best Regards,<br/>
+                    Elin Dance Studio<br/>
+                    <img src="'.config('website_url').'/assets/img/logo3.png" style="width:136px;height:115px">
+                    ';
+
                 //给这些用户发邮件
                 $result = $obj
                     ->to($order['email'])
-                    ->subject('Elin Dance Studio 套餐到期提醒!')
-                    ->message('Hi,'.$order['firstname']. ' ' .$order['lastname'].',您购买的套餐['.$order['name'].']将于'.date('Y-m-d H:i:s',$order['endtime']).'过期,建议您在过期内使用完毕!')
+                    ->subject('Your Membership Plan is Expiring in One Month’s Time!')
+                    ->message($message)
                     ->send();
 
                 //发whatsapp