1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-06 03:02:34 +01:00

Dynamic from name

This commit is contained in:
David Bomba 2021-02-19 08:43:47 +11:00
parent ee00defdc6
commit 8c52df6158
2 changed files with 5 additions and 17 deletions

View File

@ -50,21 +50,5 @@ class BouncedEmail extends Mailable
->text() ->text()
->subject($subject); ->subject($subject);
//todo
/*
//todo determine WHO is notified!! In this instance the _user_ is notified
Mail::to($invitation->user->email)
//->cc('')
//->bcc('')
->queue(new BouncedEmail($invitation));
return $this->from('x@gmail.com') //todo
->subject(ctrans('texts.confirmation_subject'))
->markdown('email.auth.verify', ['user' => $this->user])
->text('email.auth.verify_text');
*/
} }
} }

View File

@ -27,6 +27,8 @@ class TemplateEmail extends Mailable
private $contact; private $contact;
private $company;
public function __construct($build_email, ClientContact $contact) public function __construct($build_email, ClientContact $contact)
{ {
$this->build_email = $build_email; $this->build_email = $build_email;
@ -34,6 +36,8 @@ class TemplateEmail extends Mailable
$this->contact = $contact; $this->contact = $contact;
$this->client = $contact->client; $this->client = $contact->client;
$this->company = $contact->company;
} }
public function build() public function build()
@ -44,7 +48,7 @@ class TemplateEmail extends Mailable
$company = $this->client->company; $company = $this->client->company;
$this->from(config('mail.from.address'), config('mail.from.name')); $this->from(config('mail.from.address'), $this->company->present()->name());
if (strlen($settings->reply_to_email) > 1) { if (strlen($settings->reply_to_email) > 1) {
$this->replyTo($settings->reply_to_email, $settings->reply_to_email); $this->replyTo($settings->reply_to_email, $settings->reply_to_email);