| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle() |
||
| 42 | { |
||
| 43 | $expirings = Subscription::where('end_date','<=',Carbon::today()->addDays(3))->where('status','=',\constSubscription::onGoing)->get(); |
||
| 44 | |||
| 45 | $sms_trigger = Sms_trigger::where('alias','=','subscription_expiring')->first(); |
||
| 46 | $message = $sms_trigger->message; |
||
| 47 | $sms_status = $sms_trigger->status; |
||
| 48 | $sender_id = \Utilities::getSetting('sms_sender_id'); |
||
| 49 | |||
| 50 | foreach ($expirings as $expiring) |
||
| 51 | { |
||
| 52 | $sms_text = sprintf($message,$expiring->member->name,$expiring->end_date->format('d-m-Y')); |
||
| 53 | \Utilities::Sms($sender_id,$expiring->member->contact,$sms_text,$sms_status); |
||
| 54 | } |
||
| 58 |