2018-10-05 21:08:14 +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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* E-mail notification to the owner of an album that is sent when a new comment has been approved in their album.
|
|
|
|
* @package App\Mail
|
|
|
|
*/
|
2019-07-14 15:58:12 +01:00
|
|
|
class PhotoCommentApproved extends MailableBase
|
2018-10-05 21:08:14 +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;
|
|
|
|
$this->album = $album;
|
|
|
|
$this->photo = $photo;
|
|
|
|
$this->comment = $comment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Build the message.
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function build()
|
|
|
|
{
|
|
|
|
$subject = trans('email.photo_comment_approved_subject', ['album_name' => $this->album->name]);
|
|
|
|
|
|
|
|
return $this
|
|
|
|
->subject($subject)
|
|
|
|
->markdown(Theme::viewName('email.photo_comment_approved'))
|
|
|
|
->with([
|
|
|
|
'album' => $this->album,
|
|
|
|
'comment' => $this->comment,
|
|
|
|
'photo' => $this->photo,
|
|
|
|
'subject' => $subject,
|
|
|
|
'user' => $this->user
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|