本文整理汇总了PHP中Illuminate\Support\Facades\Mail::queueOn方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::queueOn方法的具体用法?PHP Mail::queueOn怎么用?PHP Mail::queueOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Mail
的用法示例。
在下文中一共展示了Mail::queueOn方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
public function register(Form $form)
{
$auth = Auth::customer();
$request = $form->request->all();
if (!$auth->findByEmail($request['email'])) {
$auth->register($request);
$user = $auth->findByEmail($request['email']);
if ($user->id) {
if (config('store.signup_email')) {
Mail::queueOn('default', config('store.email_account_confirmation'), compact('user'), function ($message) use($user) {
$message->to($user->email)->subject(trans('account.email.confirmation.subject'));
});
Message::addSuccess(trans('account.alerts.instructions_sent'));
} else {
Message::addSuccess(trans('account.alerts.account_created'));
}
} else {
foreach ($user->errors()->all(':message') as $error) {
Message::addError($error);
}
}
} else {
Message::addError(trans('account.alerts.duplicated_credentials'));
}
}
示例2: handle
/**
* Handle the event.
*
* @param EmailChangeRequested $event
*/
public function handle(EmailChangeRequested $event)
{
$user = $event->user;
$data = ['email' => $user->email, 'name' => $user->name, 'token' => $user->requestEmailToken()];
Mail::queueOn('deployer-low', 'emails.change_email', $data, function (Message $message) use($user) {
$message->to($user->email, $user->name)->subject(Lang::get('emails.confirm_email'));
});
}
示例3: sendEmail
private function sendEmail($user, $subject, $view, $data, $queue)
{
Mail::queueOn($queue, $view, $data, function ($message) use($user, $subject) {
$message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
$message->to($user->email)->subject($subject);
});
Email::create(['user_id' => $user->user_id, 'subject' => $subject, 'body' => view($view)->with($data)->render(), 'status' => EmailStatus::Sent, 'sent_at' => Carbon::now()]);
}
示例4: handle
/**
* Handle the event.
*
* @param UserWasCreated $event
*/
public function handle(UserWasCreated $event)
{
$user = $event->user;
$data = ['password' => $event->password, 'email' => $user->email];
Mail::queueOn('deployer-low', 'emails.account', $data, function (Message $message) use($user) {
$message->to($user->email, $user->name)->subject(Lang::get('emails.creation_subject'));
});
}
示例5: handle
/**
* Execute the command.
*
* @return void
*/
public function handle()
{
$emails = $this->project->notifyEmails;
if ($emails->count() > 0) {
$status = strtolower($this->project->getPresenter()->readable_status);
$subject = Lang::get('notifyEmails.subject', ['status' => $status, 'project' => $this->project->name]);
$deploymentArr = $this->deployment->toArray();
$deploymentArr['commitURL'] = $this->deployment->commit_url;
$deploymentArr['shortCommit'] = $this->deployment->short_commit;
$data = ['project' => $this->project->toArray(), 'deployment' => $deploymentArr];
Mail::queueOn('deployer-low', 'emails.deployed', $data, function (Message $message) use($emails, $subject) {
foreach ($emails as $email) {
$message->to($email->email, $email->name);
}
$message->subject($subject);
});
}
}
示例6: signup
/**
* Create a new user
* @return Illuminate\Support\Facades\Redirect
*/
public function signup()
{
$input = Input::all();
$v = Validator::make($input, array_merge(User::$rules, ['ign' => 'regex:/^([a-zA-Z0-9_\\-]+)$/']));
if ($v->fails()) {
return Redirect::route('user.register')->withInput(Input::except('password', 'password_confirmation'))->withErrors($v);
}
$user = $this->repository->signup($input);
if (is_null($user->id)) {
return Redirect::route('user.register')->withInput(Input::except('password', 'password_confirmation'))->withErrors($user->errors());
}
if (Config::get('confide::signup_email')) {
Mail::queueOn(Config::get('confide::email_queue'), 'emails.user.signup', compact('user'), function ($message) use($user) {
$message->to($user->email, $user->username)->subject(Lang::get('confide::confide.email.account_confirmation.subject'));
});
}
return Redirect::route('user.login')->with('messages', [Lang::get('confide::confide.alerts.account_created')]);
}
示例7: mailSend
/**
* Ставим отправку почты в очередь 'subscribe'
* @param $sSendTo
* @param null $sTitle
* @param null $sPreview
* @param null $sLink
*/
public function mailSend($sSendTo, $sTemplate, $arData)
{
Mail::queueOn('subscribe', $sTemplate, $arData, function ($message) use($sSendTo) {
$message->to($sSendTo);
});
}