mirror of
https://github.com/flarum/core.git
synced 2025-07-20 16:21:18 +02:00
Revert "Inject Url Generator and Translator Interface into notification mailer (#2169)"
This was actually already present and functional, so adding additional code for it
is unnecessary.
This reverts commit c73ce3e768
.
This commit is contained in:
@@ -9,11 +9,9 @@
|
|||||||
|
|
||||||
namespace Flarum\Notification;
|
namespace Flarum\Notification;
|
||||||
|
|
||||||
use Flarum\Http\UrlGenerator;
|
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
use Illuminate\Contracts\Mail\Mailer;
|
use Illuminate\Contracts\Mail\Mailer;
|
||||||
use Illuminate\Mail\Message;
|
use Illuminate\Mail\Message;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
|
||||||
|
|
||||||
class NotificationMailer
|
class NotificationMailer
|
||||||
{
|
{
|
||||||
@@ -22,26 +20,12 @@ class NotificationMailer
|
|||||||
*/
|
*/
|
||||||
protected $mailer;
|
protected $mailer;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var TranslatorInterface
|
|
||||||
*/
|
|
||||||
protected $translator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var UrlGenerator
|
|
||||||
*/
|
|
||||||
protected $url;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Mailer $mailer
|
* @param Mailer $mailer
|
||||||
* @param TranslatorInterface $translator
|
|
||||||
* @param UrlGenerator $url
|
|
||||||
*/
|
*/
|
||||||
public function __construct(Mailer $mailer, TranslatorInterface $translator, UrlGenerator $url)
|
public function __construct(Mailer $mailer)
|
||||||
{
|
{
|
||||||
$this->mailer = $mailer;
|
$this->mailer = $mailer;
|
||||||
$this->translator = $translator;
|
|
||||||
$this->url = $url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,11 +34,9 @@ class NotificationMailer
|
|||||||
*/
|
*/
|
||||||
public function send(MailableInterface $blueprint, User $user)
|
public function send(MailableInterface $blueprint, User $user)
|
||||||
{
|
{
|
||||||
$translator = $this->translator;
|
|
||||||
$url = $this->url;
|
|
||||||
$this->mailer->send(
|
$this->mailer->send(
|
||||||
$blueprint->getEmailView(),
|
$blueprint->getEmailView(),
|
||||||
compact('blueprint', 'user', 'translator', 'url'),
|
compact('blueprint', 'user'),
|
||||||
function (Message $message) use ($blueprint, $user) {
|
function (Message $message) use ($blueprint, $user) {
|
||||||
$message->to($user->email, $user->username)
|
$message->to($user->email, $user->username)
|
||||||
->subject($blueprint->getEmailSubject());
|
->subject($blueprint->getEmailSubject());
|
||||||
|
Reference in New Issue
Block a user