2018-09-20 21:32:50 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Mail;
|
|
|
|
|
|
|
|
use App\Album;
|
|
|
|
use App\Facade\Theme;
|
|
|
|
use App\Photo;
|
|
|
|
use App\PhotoComment;
|
|
|
|
use App\User;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
2019-07-14 15:58:12 +01:00
|
|
|
class ModeratePhotoComment extends MailableBase
|
2018-09-20 21:32:50 +01:00
|
|
|
{
|
|
|
|
use Queueable, SerializesModels;
|
|
|
|
|
|
|
|
private $album;
|
|
|
|
private $comment;
|
|
|
|
private $photo;
|
|
|
|
private $user;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new message instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct(User $user, Album $album, Photo $photo, PhotoComment $comment)
|
|
|
|
{
|
|
|
|
$this->user = $user;
|
2018-09-26 16:51:17 +01:00
|
|
|
$this->album = $album;
|
|
|
|
$this->photo = $photo;
|
|
|
|
$this->comment = $comment;
|
2018-09-20 21:32:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
2018-09-26 16:51:17 +01:00
|
|
|
$subject = trans('email.moderate_photo_comment_subject', ['album_name' => $this->album->name]);
|
2018-09-20 21:32:50 +01:00
|
|
|
|
|
|
|
return $this
|
|
|
|
->subject($subject)
|
2018-09-26 16:51:17 +01:00
|
|
|
->markdown(Theme::viewName('email.moderate_photo_comment'))
|
2018-09-20 21:32:50 +01:00
|
|
|
->with([
|
2018-09-26 16:51:17 +01:00
|
|
|
'album' => $this->album,
|
|
|
|
'comment' => $this->comment,
|
|
|
|
'photo' => $this->photo,
|
2018-09-20 21:32:50 +01:00
|
|
|
'subject' => $subject,
|
|
|
|
'user' => $this->user
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|