contact = $contact; } /** * Get the notification's delivery channels. * * @return array */ public function via() { return ['mail']; } /** * Get the mail representation of the notification. * * @param User $user * @return MailMessage */ public function toMail(User $user) : MailMessage { App::setLocale($user->locale); return (new MailMessage) ->subject(trans('mail.stay_in_touch_subject_line', ['name' => $this->contact->name])) ->greeting(trans('mail.greetings', ['username' => $user->first_name])) ->line(trans_choice('mail.stay_in_touch_subject_description', $this->contact->stay_in_touch_frequency, [ 'name' => $this->contact->name, 'frequency' => $this->contact->stay_in_touch_frequency, ])) ->action(trans('mail.footer_contact_info2', ['name' => $this->contact->name]), $this->contact->getLink()); } /** * Use in test to check the parameter notification. * * @param Contact $contact * @return bool */ public function assertSentFor(Contact $contact) : bool { return $contact->id == $this->contact->id; } }