本文整理汇总了PHP中Cake\Network\Email\Email类的典型用法代码示例。如果您正苦于以下问题:PHP Email类的具体用法?PHP Email怎么用?PHP Email使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Email类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invite
/**
* Index method
*
* @return void
*/
public function invite($tournament_id, $product_id, $count_teams)
{
if ($this->request->is('post')) {
foreach ($this->request->data['player'] as $i => $invites) {
$email = new Email('korujafc');
if ($this->request->data['player_status'][$i] == 'email') {
$about = '[KorujaFC] Você foi convidado para o KorujaFC!';
$message = '<img src="http://www.korujafc.com/img/logo.png" alt="logo">
<h3>Olá,</h3>
<p>Clique aqui e faça sua inscrição no site para participar do torneio:<a href="http://www.korujafc.com/products/payment/' . $product_id . '/' . $tournament_id . '">INSCREVER</a></p>
<spam><i>2016 / <a href="http://www.korujafc.com">KORUJAFC.COM</a></i></spam>';
$email->emailFormat('html')->to($invites)->subject($about)->send($message);
} elseif ($this->request->data['player_status'][$i] == 'login') {
$about = '[KorujaFC] Você foi convidado para um torneio.';
$message = '<img src="http://www.korujafc.com/img/logo.png" alt="logo">
<h3>Olá, ' . $this->request->data['player'][$i] . '</h3>
<p>Clique aqui para participar do torneio:<a href="http://www.korujafc.com/products/payment/' . $tournament_id . '">INSCREVER</a></p>
<spam><i>2016 / <a href="http://www.korujafc.com">KORUJAFC.COM</a></i></spam>';
$email->emailFormat('html')->to($this->request->data['userEmail'][$i])->subject($about)->send($message);
} elseif ($this->request->data['player_status'][$i] == 'free') {
$transactionsTable = TableRegistry::get('Transactions');
$transaction = $transactionsTable->newEntity();
$transaction->tournament_id = $tournament_id;
$transaction->product_id = $product_id;
$transaction->user_id = $this->request->data['userId'][$i];
$transactionsTable->save($transaction);
}
}
$this->Flash->success('Invitations has been sended.');
return $this->redirect(['controller' => 'Tournaments', 'action' => 'index', 1]);
}
$this->set('count_teams', $count_teams);
}
示例2: emailToManager
public function emailToManager()
{
//$this->out('Hello Manager');
$email = new Email('default');
$email->from(['admin@dimanamacet.com' => 'Administrator dimanamacet.com'])->to('aansubarkah@gmail.com')->subject('Daily Activity')->send('Lorem Ipsum DOlor sit Amet');
$this->out('Success');
}
示例3: sendMail
public function sendMail()
{
$mailer = new Email();
$mailer->transport('smtp');
$email_to = 'xuan@bliss-interactive.com';
$replyToEmail = "xuan@bliss-interactive.com";
$replyToEmailName = 'Info';
$fromEmail = "noreply@bliss-interactive.net";
$fromEmailName = "Xuan";
$emailSubject = "Demo mail";
//$view_link = Router::url('/', true);
$params_name = 'XuanNguyen';
$view_link = Router::url(['language' => $this->language, 'controller' => 'frontend', 'action' => 'view_email', 'confirmation', $params_name], true);
$sentMailSatus = array();
if (!empty($email_to)) {
//emailFormat text, html or both.
$mailer->template('content', 'template')->emailFormat('html')->subject($emailSubject)->viewVars(['data' => ['language' => $this->language, 'mail_template' => 'confirmation', 'email_vars' => ['view_link' => $view_link, 'name' => $params_name]]])->from([$fromEmail => $fromEmailName])->replyTo([$replyToEmail => $replyToEmailName])->to($email_to);
if ($mailer->send()) {
$sentMailSatus = 1;
} else {
$sentMailSatus = 0;
}
}
pr($sentMailSatus);
exit;
}
示例4: send
/**
* send mail
* @param type $id
* @param type $email
* @param type $url
* @param type $subject
* @param type $body
*/
public function send($id, $email, $url, $subject, $body)
{
$mail = new Email('default');
$key = Configure::read('key.encrypt');
$token = sha1($id . $key);
$link = Router::url('/', true) . $url . '/' . $token;
$mail->to($email)->subject($subject)->emailFormat("html")->send("<a href='" . $link . "'>" . $body . "<a>");
}
示例5: _execute
protected function _execute(array $data)
{
// aqui vai a lógica
$email = new Email('gmail');
$email->to('cursocakephp@gmail.com');
$email->subject('contato do sistema');
$msg = "\n\t\t\t<b>De:</b> {$data['nome']}<br />\n\t\t\t<b>Email:</b> {$data['email']}<br />\n\t\t\t<b>msg:</b> {$data['msg']}<br />\n\t\t";
return $email->send($msg);
}
示例6: _execute
public function _execute(array $data)
{
$mensagem = sprintf('Contato feito pelo site <br>
Nome: %s<br>
Email: %s<br>
Mensagem: %s', $data['nome'], $data['email'], $data['mensagem']);
$email = new Email('gmail');
$email->to('any@gmail.com');
$email->subject('Contato');
$email->emailFormat('html');
return $email->send($mensagem);
}
示例7: dadosAtualizados
public function dadosAtualizados()
{
$users = $ldap->getUsers("uid=*");
$emails = array();
foreach ($users as $user) {
$email = $user['uid'][0] . '@smt.ufrj.br';
array_push($emails, $email);
}
$email = new Email('gmail');
$email->from(['netadmin@smt.ufrj.br' => 'Controle de Usuarios'])->emailFormat('html')->to($emails)->subject('Notificação SMT')->send('Favor manter seus dados atualizados.');
$aviso = new Email('gmail');
$aviso->from(['netadmin@smt.ufrj.br' => 'Controle de Usuarios'])->emailFormat('html')->to('suporte.intranetsmt@gmail.com')->subject('JOB Realizado')->send('Job Dados Atualizados executado com sucesso.');
}
示例8: userSignupEmail
function userSignupEmail($event)
{
$this->emails = TableRegistry::get('Emails');
$emailTemplate = $this->emails->find()->where(['Emails.code' => 'signup_email'])->first();
$user = $event->data['user'];
$emailAddress = $user->email;
$params = ['%name%' => $user->name, '%email%' => $user->email];
$subject = str_replace(array_keys($params), array_values($params), $emailTemplate->subject);
$content = str_replace(array_keys($params), array_values($params), $emailTemplate->message);
echo $emailAddress;
$email = new Email('default');
$email->emailFormat('both')->to($emailAddress)->subject($subject)->viewVars(['content' => $content])->send();
}
示例9: sendMail
/**
* Check email in stack and send to user
* @throws Exception
* @return void
*/
public function sendMail()
{
$mails = $this->EmailStacks->find()->where(['sent' => false]);
$dataResult = [];
foreach ($mails as $row) {
$email = new Email('default');
if ($email->to($row->email)->subject($row->subject)->send($row->content)) {
$ent = $this->EmailStacks->get($row->id);
$ent->sent = true;
$this->EmailStacks->save($ent);
}
}
}
示例10: _execute
protected function _execute(array $data)
{
//print_r($data); exit;
if (null != $data['email']) {
$adminEmail = "contact@marketingconnex.com";
//EMAIL THE Admin
$subject = __('A new form submission been received from the MarketingConneX.com Challenges landing page');
$email = new Email('default');
$email->sender($data['email'], $data['firstname']);
$email->from([$data['email'] => $data['firstname']])->to([$adminEmail => 'marketingconneX.com'])->subject($subject)->emailFormat('html')->template('landingpageform')->viewVars(array('firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'website' => $data['website'], 'phone' => $data['phone'], 'info' => $data['info'], 'landingpage' => $data['landingpage']))->send();
return true;
}
return false;
}
示例11: sendMail
/**
* Check email in stack and send to user
* @throws Exception
* @return void
*/
public function sendMail()
{
$mails = $this->EmailStacks->find()->where(['sent' => false]);
$dataResult = [];
foreach ($mails as $row) {
$email = new Email('default');
if ($email->emailFormat('html')->template('content')->to($row->email)->subject($row->subject)->viewVars(['content' => $row->content])->send()) {
$ent = $this->EmailStacks->get($row->id);
$ent->sent = true;
$this->EmailStacks->save($ent);
}
}
return true;
}
示例12: reminder
public function reminder()
{
if ($this->request->is('post')) {
$user = $this->Users->findByEmail($this->request->data['email'])->first();
if ($user) {
$email = new Email('default');
$email->template('reminder', 'default')->to($user->email)->subject('Recuperação de Senha')->viewVars(['name' => $user->name, 'email' => $user->email, 'password' => (new LegacyPasswordHasher())->decode($user->password)])->send();
unset($this->request->data['email']);
$this->Flash->success(__('We sent an email to you. Open your inbox to check your password.'), ['key' => 'auth']);
} else {
$this->Flash->error(__('E-mail does not exist.'), ['key' => 'auth']);
}
}
}
示例13: contact
/**
* Alari Contact
*/
public function contact()
{
if ($this->request->is('post')) {
//Send email to admin after saving the inquiry
$data = [];
$data['from'] = $this->request->data['FullName'];
$data['email'] = $this->request->data['Email'];
$data['message'] = $this->request->data['Message'];
$email = new Email('default');
$email->template('inquiry')->emailFormat('text')->subject('Inquiry')->to(OWNER_EMAIL)->viewVars($data)->send();
$this->Flash->success('Your inquiry has been sent successfully.');
return $this->redirect(['action' => 'contact']);
}
}
示例14: resetPass
public function resetPass($email)
{
if (!isset($email)) {
return false;
}
$users = TableRegistry::get('Users');
$user = $users->find()->where(['Users.email' => $email])->first();
if (!isset($user)) {
return false;
}
$msg = new Email();
$msg->transport('default')->from(['gm@vgphotohunt.com' => 'Game Master'])->to($user->email)->subject('VGPhotohunt - Reset Your Password')->template('resetPass')->viewVars(['token' => $user->confirmation_token, 'username' => $user->username])->send();
return true;
}
示例15: send
/**
*
* @author Anand Thakkar <anand@phpconsultant.co>
* @param Email $email
* @throws \App\Network\Email\Mandrill_ErrorS
*/
public function send(Email $email)
{
$headers = $email->getHeaders(['from', 'sender', 'replyTo', 'to', 'cc', 'bcc']);
try {
$message = array('html' => '<p>This is the body of the Email</p>', 'text' => 'This is the body of the Email', 'subject' => 'Testing mandrill Application', 'from_email' => $headers['From'], 'from_name' => $headers['Sender'], 'to' => array(array('email' => $headers['To'], 'type' => 'to')), 'headers' => array('Reply-To' => $headers['Reply-To']), 'important' => false);
$async = false;
$ip_pool = 'Main Pool';
$send_at = FALSE;
$result = $this->mandrill->messages->send($message, $async, $ip_pool, $send_at);
} catch (Mandrill_Error $e) {
echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
//throw $e;
}
}