本文整理匯總了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();
}