本文整理汇总了PHP中Illuminate\Contracts\Mail\Mailer类的典型用法代码示例。如果您正苦于以下问题:PHP Mailer类的具体用法?PHP Mailer怎么用?PHP Mailer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mailer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$data = ['title' => 'ChickenElectric-Xác nhận người dùng.', 'intro' => 'Cảm ơn bạn vì đã đăng ký làm thành viên của ChickenElectric. Chúng tôi sẽ gửi tới bạn các thông tin mới nhất về các bài viết. Để active tài khoản hãy truy cập vào đường link sau.', 'register_token' => $this->_user->register_token];
$mailer->send('email.auth.verify', $data, function ($message) {
$message->to($this->_user->email, 'doankhoi')->subject('ChickenElectric');
});
}
示例2: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$data = ['title' => $this->attempt->user->name . ' invited you to attempt the ' . $this->attempt->challenge->title . ' challenge.', 'name' => $this->user->name, 'email' => $this->user->email, 'content' => null, 'url' => 'https://gamechalleng.es/notifications', 'url_text' => 'View Notifications'];
$mailer->send('emails.transactional', $data, function ($m) use($data) {
$m->to($data['email'], $data['name'])->subject($data['title']);
});
}
示例3: handle
/**
* Execute the job.
*
* @param Mailer $mailer
* @return void
*/
public function handle(Mailer $mailer)
{
echo 'Sending email.' . PHP_EOL;
if ($this->attempts() > 1) {
$this->delete();
}
$users = $this->getUsers($this->dir . '/userlist.xlsx');
$html = file_get_contents($this->dir . '/email.html');
foreach ($users as $index => $user) {
$index++;
if (!filter_var($user, FILTER_VALIDATE_EMAIL)) {
continue;
}
$mailer->send('laravel-sender::email.html', ['html' => $html], function ($m) use($user) {
$m->from($this->from, $this->fromTitle);
$m->to($user, null)->subject($this->title);
});
var_dump($user);
if ($index % 10 === 0) {
sleep(5);
}
}
/*
*/
echo 'end.' . PHP_EOL;
$this->delete();
}
示例4: handle
/**
* Execute the job.
*
* @param Mailer $mailer
* @return void
*/
public function handle(Mailer $mailer)
{
$mailer->send('emails.verify', [], function ($message) {
$message->from(env('MAIL_FROM'), 'Easymanage.in');
$message->to($this->emailAddress)->subject('Please Verify Your Easymanage.in Account');
});
}
示例5: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$teachers = $this->teachers;
foreach ($teachers as $teacher) {
$message = new TeacherMessage();
$message->sender_id = $this->sender_id;
$message->email = $this->email;
$message->sms = $this->sms;
$message->teacher_id = $teacher->id;
$data = ['content' => $this->email];
$attachments = $this->attachments;
if ($this->email) {
$mailer->send('teachers::emails.message', $data, function ($m) use($teacher, $attachments) {
$m->to($teacher->email, $teacher->name)->from(config('teachers.from_email'))->subject("subject");
if (!empty($attachments)) {
foreach ($attachments as $a) {
$m->attach($a);
}
}
});
$message->email_sent = 1;
}
if ($this->sms) {
$sms = new SmsGateway($this->sms, [$teacher->mobile]);
$result = $sms->send();
if ($result->getPushMessageResult()->PushMessageResult == 1) {
$message->sms_sent = 1;
}
}
$message->save();
}
event(new TeachersMessagesQueueFinished());
}
示例6: handle
/**
* Handler
*
* @param \Illuminate\Contracts\Mail\Mailer $mailer
* @param \Illuminate\Contracts\View\Factory $view
* @param \Illuminate\Contracts\Validation\Factory $validator
* @throws \Exception
* @return void
*/
public function handle(Mailer $mailer, Factory $view, Validator $validator)
{
$queue = $this->messageQueue;
$queue->status = 'in_processes';
$queue->save();
$queue->load('event', 'event.template');
$parameters = array_merge_recursive($queue->event->template->parameters, $queue->event->parameters, $queue->parameters);
$messageParameters = array_dot($this->getMessageParameters($validator, $parameters['message']));
$renderView = $queue->event->template->getRender($parameters['view']);
$mailer->send('message-sender::providers.plain', ['content' => $renderView], function ($message) use($parameters, $messageParameters) {
$message->from($messageParameters['from.address'], $messageParameters['from.name']);
$message->to($messageParameters['to.address'], $messageParameters['from.name']);
$message->subject($parameters['provider']['subject']);
if (isset($parameters['provider']['headers'])) {
$mailHeaders = $message->getSwiftMessage()->getHeaders();
foreach ($parameters['provider']['headers'] as $header) {
$mailHeaders->addTextHeader($header['name'], $header['value']);
}
}
});
if (count($mailer->failures()) > 0) {
throw new \Exception('Mail send failed.');
} else {
$queue->status = 'sent';
$queue->save();
}
}
示例7: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$mailer->send('emails.invite', ['email' => $this->auth_user_email, 'name' => $this->auth_user_name], function ($message) {
$message->from($this->auth_user_email, $this->auth_user_name);
$message->to($this->email)->subject('Invite to join Invite');
});
}
示例8: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$this->inscription->load('colloque');
$annexes = $this->inscription->colloque->annexe;
// Generate annexes if any
if (empty($this->inscription->documents) && !empty($annexes)) {
$this->generator->setInscription($this->inscription)->generate($annexes);
}
$date = \Carbon\Carbon::now()->formatLocalized('%d %B %Y');
$title = 'Votre inscription sur publications-droit.ch';
$logo = 'facdroit.png';
$user = $this->inscription->user;
$annexes = $this->inscription->documents;
$data = ['title' => $title, 'logo' => $logo, 'concerne' => 'Inscription', 'annexes' => $this->inscription->colloque->annexe, 'inscription' => $this->inscription, 'date' => $date];
$mailer->send('emails.colloque.confirmation', $data, function ($message) use($user, $annexes) {
$email = $this->email ? $this->email : $user->email;
$message->to($email, $user->name)->subject('Confirmation d\'inscription');
if (!empty($annexes)) {
foreach ($annexes as $annexe) {
$message->attach($annexe['file'], array('as' => $annexe['name'], 'mime' => 'application/pdf'));
}
}
});
$this->inscription->send_at = date('Y-m-d');
$this->inscription->save();
}
示例9: handle
/**
* Execute the job.
*
* @param Mailer $mailer
* @return void
*/
public function handle(Mailer $mailer)
{
$data = ['title' => trans('front/verify.email-title'), 'intro' => trans('front/verify.email-intro'), 'link' => trans('front/verify.email-link'), 'confirmation_code' => $this->user->confirmation_code];
$mailer->send('emails.auth.verify', $data, function ($message) {
$message->to($this->user->email, $this->user->username)->subject(trans('front/verify.email-title'));
});
}
示例10: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$mailer->send('emails.reminder', ['user' => $this->user], function ($m) {
//
});
//$this->user->reminders()->create(...);
}
示例11: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$data = ['title' => trans('front/verify.ReviewEmail'), 'intro' => trans('front/verify.email-intro'), 'link' => trans('front/verify.email-link'), 'confirmation_code' => $this->reviewU->confirmation_rev_code];
$mailer->send('emails.auth.VerifyReview', $data, function ($message) {
$message->to($this->reviewU->email_reviewer, $this->reviewU->nombre_reviewer)->subject("Review Verify iWaNaTrip.com");
});
}
示例12: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$data = ['title' => "Invitación iWaNaTrip.com", 'nombrede' => $this->invitacion->invitacion_de, 'nombrepara' => $this->invitacion->invitacion_para];
$mailer->send('emails.auth.inviteFriend', $data, function ($message) {
$message->to($this->invitacion->correo, $this->invitacion->invitacion_para)->subject("Invitación iWaNaTrip.com");
});
}
示例13: handle
/**
* Execute the job.
*
* @return void
*/
public function handle(Mailer $mailer)
{
$mailer->send('emails.mailer', ['user' => $this->user], function ($m) {
$m->from('jiacai.ding@shinsoft.net');
$m->to('dingjc89@126.com');
});
}
示例14: handle
/**
* Execute the job.
*
* @param Mailer $mailer
* @return void
*/
public function handle(Mailer $mailer)
{
$mailer->raw('You have received a new purchase of ' . $this->receipt->product->credits . ' credits for ' . $this->receipt->price, function ($message) {
$message->from('billing@whatscarrier.com', 'Whatscarrier');
$message->subject('You have received new purchase')->to('mohd.sulaiman@sudirman.info');
});
}
示例15: handle
/**
* Handle the event.
*
* @param SubscriptionPayment\FailedInsufficientFunds $event
*/
public function handle(SubscriptionPayment\FailedInsufficientFunds $event)
{
$user = $this->userRepository->getById($event->userId);
$this->mailer->send('emails.sub-payment-failed', ['user' => $user], function ($m) use($user) {
$m->to($user->email, $user->name)->subject('Your subscription payment failed');
});
}
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:12,代码来源:EmailMemberAboutFailedSubscriptionPayment.php