本文整理汇总了PHP中Illuminate\Contracts\Mail\Mailer::raw方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::raw方法的具体用法?PHP Mailer::raw怎么用?PHP Mailer::raw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Mail\Mailer
的用法示例。
在下文中一共展示了Mailer::raw方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* @param RequestPasswordReset $command
* @return \Flarum\Core\User
* @throws ModelNotFoundException
*/
public function handle(RequestPasswordReset $command)
{
$user = $this->users->findByEmail($command->email);
if (!$user) {
throw new ModelNotFoundException();
}
$token = PasswordToken::generate($user->id);
$token->save();
$data = ['{username}' => $user->username, '{url}' => $this->url->toRoute('resetPassword', ['token' => $token->id]), '{forum}' => $this->settings->get('forum_title')];
$body = $this->translator->trans('core.email.reset_password.body', $data);
$this->mailer->raw($body, function (Message $message) use($user, $data) {
$message->to($user->email);
$message->subject('[' . $data['{forum}'] . '] ' . $this->translator->trans('core.email.reset_password.subject'));
});
return $user;
}
示例2: 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');
});
}
示例3: handle
/**
* {@inheritdoc}
*/
public function handle(ServerRequestInterface $request)
{
$id = array_get($request->getQueryParams(), 'id');
$actor = $request->getAttribute('actor');
$this->assertRegistered($actor);
if ($actor->id != $id || $actor->is_activated) {
throw new PermissionDeniedException();
}
$token = EmailToken::generate($actor->email, $actor->id);
$token->save();
$data = ['{username}' => $actor->username, '{url}' => $this->url->toRoute('confirmEmail', ['token' => $token->id]), '{forum}' => $this->settings->get('forum_title')];
$body = $this->translator->trans('core.email.activate_account.body', $data);
$this->mailer->raw($body, function (Message $message) use($actor, $data) {
$message->to($actor->email);
$message->subject('[' . $data['{forum}'] . '] ' . $this->translator->trans('core.email.activate_account.subject'));
});
return new EmptyResponse();
}
示例4: whenUserEmailChangeWasRequested
/**
* @param \Flarum\Event\UserEmailChangeWasRequested $event
*/
public function whenUserEmailChangeWasRequested(UserEmailChangeWasRequested $event)
{
$email = $event->email;
$data = $this->getEmailData($event->user, $email);
$body = $this->translator->trans('core.email.confirm_email.body', $data);
$this->mailer->raw($body, function (Message $message) use($email, $data) {
$message->to($email);
$message->subject('[' . $data['{forum}'] . '] ' . $this->translator->trans('core.email.confirm_email.subject'));
});
}
示例5: emailOutput
/**
* E-mail the output of the event to the recipients.
*
* @param \Illuminate\Contracts\Mail\Mailer $mailer
* @param array $addresses
* @param bool $onlyIfOutputExists
* @return void
*/
protected function emailOutput(Mailer $mailer, $addresses, $onlyIfOutputExists = false)
{
$text = file_get_contents($this->output);
if ($onlyIfOutputExists && empty($text)) {
return;
}
$mailer->raw($text, function ($m) use($addresses) {
$m->subject($this->getEmailSubject());
foreach ($addresses as $address) {
$m->to($address);
}
});
}
示例6: emailOutput
/**
* E-mail the output of the event to the recipients.
*
* @param \Illuminate\Contracts\Mail\Mailer $mailer
* @param array $addresses
* @return void
*/
protected function emailOutput(Mailer $mailer, $addresses)
{
$mailer->raw(file_get_contents($this->output), function ($m) use($addresses) {
$m->subject($this->getEmailSubject());
foreach ($addresses as $address) {
$m->to($address);
}
});
}
示例7: handle
/**
* 受け取ったイベントをメールで送信する
*/
public function handle(HubConnectionBaseEvent $event)
{
$this->mailer->raw($event, function ($m) {
$m->to('my@example.com', '自分')->subject('Hubサイトのメール通知');
});
}
示例8: send
public function send()
{
$this->mailer->raw($this->message, function (Message $message) {
$message->subject($this->subject)->from($this->config['from'])->to($this->config['to']);
});
}
示例9: sendRaw
/**
* Send raw message
*
* @param $text
* @param $subject
* @param $to
*/
public function sendRaw($text, $subject, $to)
{
$this->mailer->raw($text, function ($message) use($subject, $to) {
$message->to($to)->subject($subject);
});
}