本文整理汇总了PHP中Cake\Mailer\Email::addBcc方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::addBcc方法的具体用法?PHP Email::addBcc怎么用?PHP Email::addBcc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Mailer\Email
的用法示例。
在下文中一共展示了Email::addBcc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _execute
protected function _execute(array $data)
{
$email = new Email('default');
$email->from(['entec.ifpe.igarassu@gmail.com' => 'EnTec 2016'])->emailFormat('html')->replyTo('entec.ifpe.igarassu@gmail.com', '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: sendInvitations
/**
* 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();
}