NathanGeerinck /
laravel-newsletter
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace App\Mail; |
||||
| 4 | |||||
| 5 | use App\Models\Campaign; |
||||
| 6 | use Illuminate\Bus\Queueable; |
||||
| 7 | use Illuminate\Mail\Mailable; |
||||
| 8 | use Illuminate\Queue\SerializesModels; |
||||
| 9 | |||||
| 10 | /** |
||||
| 11 | * @param $subscriptions |
||||
| 12 | * @property Campaign campaign |
||||
| 13 | */ |
||||
| 14 | class CampaignSendMail extends Mailable |
||||
| 15 | { |
||||
| 16 | use Queueable, SerializesModels; |
||||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||||
| 17 | |||||
| 18 | public $subscriptions; |
||||
| 19 | public $campaign; |
||||
| 20 | |||||
| 21 | public function __construct($subscriptions, Campaign $campaign) |
||||
| 22 | { |
||||
| 23 | $this->subscriptions = $subscriptions; |
||||
| 24 | $this->campaign = $campaign; |
||||
| 25 | } |
||||
| 26 | |||||
| 27 | /** |
||||
| 28 | * Build the message. |
||||
| 29 | * |
||||
| 30 | * @return $this |
||||
| 31 | */ |
||||
| 32 | public function build() |
||||
| 33 | { |
||||
| 34 | return $this->markdown('emails.campaigns.send', ['campaign' => $this->campaign->name, 'subscribers' => count($this->subscriptions)]) |
||||
| 35 | ->subject(trans('emails.campaigns.send.subject')); |
||||
|
0 ignored issues
–
show
It seems like
trans('emails.campaigns.send.subject') can also be of type array; however, parameter $subject of Illuminate\Mail\Mailable::subject() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 36 | } |
||||
| 37 | } |
||||
| 38 |