本文整理匯總了PHP中Illuminate\Contracts\Mail\Mailer::send方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mailer::send方法的具體用法?PHP Mailer::send怎麽用?PHP Mailer::send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Contracts\Mail\Mailer
的用法示例。
在下文中一共展示了Mailer::send方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle
/**
* Handle the event.
*
* @param UnknownPayPalPaymentReceived $event
*/
public function handle(UnknownPayPalPaymentReceived $event)
{
$email = $event->emailAddress;
$payment = $this->paymentRepository->getById($event->paymentId);
$this->mailer->send('emails.paypal-donation', ['email' => $email, 'payment' => $payment], function ($m) use($email) {
$m->to($email);
$m->cc('trustees@buildbrighton.com');
$m->subject('Unknown PayPal Payment Received');
});
}
示例2: handle
/**
* Handle the event.
*
* @param MemberGivenTrustedStatus $event
*/
public function handle(MemberGivenTrustedStatus $event)
{
$user = $event->user;
$this->mailer->send('emails.made-trusted-member', ['user' => $event->user], function ($m) use($user) {
$m->to($user->email, $user->name)->subject('You have been made a trusted member');
});
}
示例3: handle
/**
* Handle the event.
*
* @param InquiryWasCreated $event
* @return void
*/
public function handle(InquiryWasCreated $event)
{
$this->mailer->send('emails.inquiry', ['inquiry' => $event->inquiry], function ($m) use($event) {
$m->from(config('site.email'), config('site.company'));
$m->to(config('site.notificationEmail'), config('site.company'))->subject('New Inquiry');
});
}
示例4: handle
/**
* Handle the event.
*
* @param TaskCreatedEvent $event
* @return void
*/
public function handle(TaskCreatedEvent $event)
{
$this->mailer->send('emails.new_task', ['task' => $event->getTask()], function ($m) {
$m->from('hello@app.com', 'Your Application');
$m->to('example@email.com', 'destinatario')->subject('Task creato!');
});
}
示例5: 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
示例6: send
/**
* Send the given notification.
*
* @param mixed $notifiable
* @param \Illuminate\Notifications\Notification $notification
* @return void
*/
public function send($notifiable, Notification $notification)
{
if (!$notifiable->routeNotificationFor('mail')) {
return;
}
$message = $notification->toMail($notifiable);
if ($message instanceof Mailable) {
return $message->send($this->mailer);
}
$this->mailer->send($message->view, $message->data(), function ($m) use($notifiable, $notification, $message) {
$recipients = empty($message->to) ? $notifiable->routeNotificationFor('mail') : $message->to;
if (!empty($message->from)) {
$m->from($message->from[0], isset($message->from[1]) ? $message->from[1] : null);
}
if (is_array($recipients)) {
$m->bcc($recipients);
} else {
$m->to($recipients);
}
$m->subject($message->subject ?: Str::title(Str::snake(class_basename($notification), ' ')));
foreach ($message->attachments as $attachment) {
$m->attach($attachment['file'], $attachment['options']);
}
foreach ($message->rawAttachments as $attachment) {
$m->attachData($attachment['data'], $attachment['name'], $attachment['options']);
}
});
}
示例7: handle
/**
* Handle the event.
*
* @param ExpenseWasApproved $event
* @return void
*/
public function handle(ExpenseWasApproved $event)
{
$user = $event->expense->user;
$this->mailer->send('emails.expense-approved', ['user' => $event->expense->user, 'expense' => $event->expense], function ($m) use($user) {
$m->to($user->email, $user->name)->subject('Your expense was approved');
});
}
示例8: handle
/**
* Handle the event.
*
* @param \Apolune\Account\Events\Email\RequestAccepted $event
* @return void
*/
public function handle(Email\RequestAccepted $event)
{
list($account, $password) = [$event->account, $event->password];
$this->mailer->send('theme::_emails.new-email', compact('account', 'password'), function ($message) use($account) {
$message->to($account->email());
$message->subject(trans('theme::_emails/new-email.title', ['server' => server()->name()]));
});
}
示例9: sendEmailForConfirmation
/**
* 이메일 인증을 위한 이메일을 전송한다.
*
* @param EmailInterface $mail 전송할 이메일 정보
* @param null|Closure $callback 이메일 전송할 때 처리할 로직
*
* @return void
*/
public function sendEmailForConfirmation(EmailInterface $mail, $callback = null)
{
$this->mailer->send($this->view, compact('mail'), function ($m) use($mail, $callback) {
$m->to($mail->getAddress());
if (!is_null($callback)) {
call_user_func($callback, $m, $mail);
}
});
}
示例10: create
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
$token = str_random(60);
$user = User::create(['name' => $data['name'], 'email' => $data['email'], 'confirmation_token' => $token, 'password' => bcrypt($data['password'])]);
$this->mailer->send(['emails.register', 'emails.register-text'], compact('token', 'user'), function ($message) use($user) {
$message->to($user->email)->subject('Confirmation de votre compte');
});
return $user;
}
示例11: whenUserEmailChangeWasRequested
/**
* @param \Flarum\Events\UserEmailChangeWasRequested $event
*/
public function whenUserEmailChangeWasRequested(UserEmailChangeWasRequested $event)
{
$email = $event->email;
$data = $this->getEmailData($event->user, $email);
$this->mailer->send(['text' => 'flarum::emails.confirmEmail'], $data, function (Message $message) use($email) {
$message->to($email);
$message->subject('Confirm Your New Email Address');
});
}
示例12: sendNewPassword
public function sendNewPassword(CanResetPassword $user)
{
$password = str_random(8);
$user->password = $password;
$user->save();
$this->mailer->send('auth::emails.new_password', compact('user', 'password'), function ($m) use($user) {
$m->to($user->getEmailForPasswordReset());
});
}
示例13: handle
public function handle(ModuleWasSubmittedForApproval $event)
{
$module = $event->module;
$this->mailer->send('module::emails.module-submitted-notification', compact('module'), function (Message $message) use($module) {
$message->subject('AsgardCms: New module submitted');
$message->to('n.widart@gmail.com');
$message->replyTo($module->user->email);
});
}
示例14: handle
/**
* Handle the event.
*
* @param mixed $event
* @return void
*/
public function handle($event)
{
$account = $event->account;
$account->load('properties');
$this->mailer->send('theme::_emails.verification', compact('account'), function ($message) use($account) {
$message->to($account->email());
$message->subject('Testing');
});
}
示例15: registerUser
/**
* @param array $params
*
* @return \App\DataAccess\Eloquent\User
*/
public function registerUser(array $params)
{
$user = $this->user->save($params);
$this->mailer->send('emails.register', ['user' => $user], function ($m) use($user) {
/** @var \Illuminate\Mail\Message $m */
$m->sender('laravel-reference@example.com', 'Laravelリファレンス')->to($user->email, $user->name)->subject('ユーザー登録が完了しました');
});
return $user;
}