本文整理汇总了PHP中Illuminate\Mail\Mailer::queue方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::queue方法的具体用法?PHP Mailer::queue怎么用?PHP Mailer::queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Mail\Mailer
的用法示例。
在下文中一共展示了Mailer::queue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* 發送Email
*
* @param array $request
*/
public function send(array $request)
{
$this->mail->queue('email.index', $request, function (Message $message) {
$message->send(env('MAIL_USERNAME'));
$message->subject(env('MAIL_SUBJECT'));
$message->to(env('MAIL_TO_ADDR'));
});
}
示例2: sendTo
/**
* Send an email.
*
* @param Traversable|string $email
* @param $subject
* @param $view
* @param $data
*/
public function sendTo($email, $subject, $view, $data = [])
{
if (!$email instanceof Traversable) {
$email = [$email];
}
foreach ($email as $singleEmailAddress) {
$this->mail->queue($view, $data, function ($message) use($singleEmailAddress, $subject) {
$message->to($singleEmailAddress)->subject($subject);
});
}
}
示例3: sendTo
public function sendTo($user, $subject, $view, $data = [])
{
$this->mail->queue($view, $data, function ($message) use($user, $subject) {
$message->subject($subject);
if (is_object($user)) {
$message->to($user->email, $user->name);
} else {
$message->to($user);
}
});
}
示例4: sendEmail
/**
* Send an email to the conversation owner.
*
* @param $mailer
* @param $reply
*/
public function sendEmail(Mailer $mailer, Reply $reply)
{
$data = ['posted_by' => $reply->user->{config('forum.user.username')}, 'link' => route('forum.conversation.show', $reply->conversation->slug)];
$mailer->queue('Forum::Emails.template', ['data' => $data], function ($message) use($reply) {
$message->from(config('forum.emails.from'), config('forum.emails.from-name'));
$message->to($reply->user->email, $reply->user->{config('forum.user.username')})->subject(config('forum.emails.subject'));
});
}
开发者ID:elNapoli,项目名称:iCnca7CrTNYXRF4oxPSidusv17MoVk7CEAhNGFGcYHSu0DNSy7Hkq,代码行数:14,代码来源:PostReply.php
示例5: send
/**
* Send message.
*
* @param $view
* @param array $data
* @param $mailingList
* @param null $attachement
*
* @return bool
*/
public function send($view, $data = [], $mailingList, $attachement = null)
{
$config = App::make(Config::class);
$emailParams = $config->get('These.admin.email');
// If the file size is bigger than 20 Mo do not attach the file
if (is_null($attachement) || filesize($attachement) > 20000000) {
$attachement = false;
}
$this->mail->queue($view, $data, function ($message) use($mailingList, $attachement, $emailParams) {
$message->from($emailParams['from'], $emailParams['name']);
$message->subject('Administration de Thèse ALR');
$message->to($mailingList);
if ($attachement) {
$message->attach($attachement);
}
});
return true;
}
示例6: queue
/**
* Queue a new e-mail message for sending.
*
* @param string|array $view
* @param array $data
* @param \Closure|string $callback
* @param string|null $queue
* @return mixed
* @static
*/
public static function queue($view, $data, $callback, $queue = null)
{
return \Illuminate\Mail\Mailer::queue($view, $data, $callback, $queue);
}
示例7: sendTo
/**
* sendTo
*
* @param $user
* @param $subject
* @param $view
* @param $data
*
* @return mixed
* @author Alonzo Tolver <alonzotolver@gmail.com>
*
**/
public function sendTo($user, $subject, $view, $data = [])
{
$this->mail->queue($view, $data, function ($message) use($user, $subject) {
$message->to($user->email)->subject($subject);
});
}
示例8: sendTo
/**
* @param \HorseStories\Models\Users\User $user
* @param string $subject
* @param string $view
* @param array $data
*/
public function sendTo(User $user, $subject, $view, $data = [])
{
$this->mail->queue($view, $data, function ($message) use($user, $subject) {
$message->to('test@test.com')->subject($subject);
});
}
示例9: queue
/**
* Queue a new e-mail message for sending.
*
* @param string $queue
* @return int
*/
public function queue($queue = null)
{
return $this->mailer->queue($this->view, $this->data, $this->prepareCallback(), $queue);
}