Commit 853d882a02df734db70487c1295f5aca51536a75

Authored by Administrator
1 parent 576e8c45

change request to massage

Showing 1 changed file with 30 additions and 0 deletions   Show diff stats
src/app/tasks/EventMailTask.php
... ... @@ -34,6 +34,36 @@ class EventMailTask extends \Phalcon\CLI\Task
34 34 $this->seriesOfLettersAction();
35 35 }
36 36  
  37 + public function seriesOfLettersAction(){
  38 + die('here');
  39 + $projects = $this->getActiveProjects();
  40 +
  41 + foreach($projects as $project){
  42 +
  43 + $events = $this->eventByTrigger($project,'series_of_letter');
  44 +
  45 + foreach($events as $event){
  46 +
  47 + if(!$event->isNew() ){
  48 + if(!$event->isRecurring()){
  49 + continue;
  50 + }
  51 + }
  52 + print_r($event->toArray());
  53 +
  54 + $customers = $project->findUsersByBirthday();
  55 + foreach($customers as $customer){
  56 + $this->post['name']=$customer->name;
  57 + $this->post['email']=$customer->email;
  58 + $this->post['phone']=$customer->phone;
  59 + $this->post['address']=$customer->address;
  60 + $this->sendMail($customer->toArray(),$project,$event,$event->eventEmail->toArray());
  61 + }
  62 +
  63 + }
  64 + }
  65 + }
  66 +
37 67 public function actionEventAction(){
38 68 $projects = $this->getActiveProjects();
39 69  
... ...