本文整理汇总了PHP中Illuminate\Support\Facades\Mail::later方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::later方法的具体用法?PHP Mail::later怎么用?PHP Mail::later使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Mail
的用法示例。
在下文中一共展示了Mail::later方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: queue
public function queue()
{
$data = ['name' => 'Ryan'];
Mail::later(5, 'emails.queued_mail', $data, function ($message) {
$message->to('rkang.sendme@gmail.com', 'Ryan Kang')->subject('Welcome! This is a queued mail');
});
return 'Email will be sent in 5 seconds';
}
示例2: sendNewsLetter
public function sendNewsLetter($data, $name, $email, $title)
{
Mail::later(1, 'emails.newsletter', ['data' => $data], function ($message) use($name, $email, $title) {
$message->from(\Cache::get('contactusInfo')->email, 'Newsletter - 7orof.com');
$message->subject('7orof.com | Newsletter | ' . $title);
$message->priority('high');
$message->to($email);
});
}
示例3: handle
/**
* Handle the event.
*
* @param SendRegisterationConfirmationEmail $event
* @return void
*/
public function handle(SendRegisterationConfirmationEmail $event)
{
$user = $event->user;
$email = $user->email;
Mail::later(1, 'emails.confirm', ['data' => ['id' => $user->id]], function ($message) use($email) {
$message->from(\Cache::get('contactusInfo')->email, ' | 7orof.com');
$message->subject('7orof.com | Email Confirmation');
$message->priority('high');
$message->to($email);
});
}
示例4: callQueue
protected function callQueue($template, array $values = [], $queueTime = null)
{
if (empty($queueTime)) {
Mail::queue($template, $values, function ($message) {
$this->sendClosure($message);
});
return $this;
}
Mail::later($queueTime, $template, $values, function ($message) {
$this->sendClosure($message);
});
return $this;
}
示例5: function
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use Illuminate\Support\Facades\Mail;
Route::get('/', function () {
return view('welcome');
});
Route::post('/search-results', function () {
return sprintf('Search results For "%s"', Request::input('search'));
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::get('mail/queue', function () {
Mail::later(5, 'emails.queued_email', ['name' => 'sudip sarker'], function ($message) {
$vari = rand(1, 100);
$message->to('sudip2222@diu.edu.bd', 'Sudip Kumar Sarker')->subject($vari);
});
return 'Email will be sent in 5 secend .....';
});
示例6: function
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use Illuminate\Support\Facades\Mail;
Route::get('/', function () {
return view('welcome');
});
Route::get('mail/queue', function () {
Mail::later(5, 'emails.queue', ["name" => "Rodolfo"], function ($message) {
$message->to('gargamer11@gmail.com', 'Kevin Ventura')->subject('Sistema de Colas');
});
return 'Este email se enviara en 5 segundos';
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//