コード例 #1
0
ファイル: EmailForm.php プロジェクト: AlexandreSGV/siteentec
 protected function _execute(array $data)
 {
     $email = new Email('default');
     $email->from(['*****@*****.**' => 'EnTec 2016'])->emailFormat('html')->replyTo('*****@*****.**', 'EnTec 2016')->subject('[EntTec 2016] ' . $data['assunto']);
     $destinatarios = $data['destinatarios'];
     for ($i = 0, $c = count($destinatarios); $i < $c; $i++) {
         $email->addBcc($destinatarios[$i]['email'], $destinatarios[$i]['nome']);
     }
     $email->send($data['corpo']);
     return true;
 }
コード例 #2
0
ファイル: Mailer.php プロジェクト: BallStateCBER/cri
 /**
  * Sends survey invitations
  *
  * @param array $params [surveyId, communityId, senderEmail, senderName, recipients]
  * @return array
  */
 public function sendInvitations($params)
 {
     extract($params);
     $surveysTable = TableRegistry::get('Surveys');
     $survey = $surveysTable->get($surveyId);
     $communitiesTable = TableRegistry::get('Communities');
     $clients = $communitiesTable->getClients($communityId);
     $email = new Email('survey_invitation');
     $email->to(Configure::read('noreply_email'));
     if ($senderEmail) {
         $email->replyTo($senderEmail, $senderName);
     }
     foreach ($recipients as $recipient) {
         $email->addBcc($recipient);
     }
     $email->viewVars(['clients' => $clients, 'criUrl' => Router::url('/', true), 'surveyType' => $survey->type, 'surveyUrl' => $survey->sm_url]);
     return $email->send();
 }