mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for From name for client password reset
This commit is contained in:
parent
a6799c070e
commit
3cf5ae9056
@ -35,7 +35,13 @@ class NinjaMailer extends Mailable
|
|||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
$from_name = config('mail.from.name');
|
||||||
|
|
||||||
|
if(property_exists($this->mail_obj, 'from_name')){
|
||||||
|
$from_name = $this->mail_obj->from_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->from(config('mail.from.address'), $from_name)
|
||||||
->subject($this->mail_obj->subject)
|
->subject($this->mail_obj->subject)
|
||||||
->view($this->mail_obj->markdown, $this->mail_obj->data)
|
->view($this->mail_obj->markdown, $this->mail_obj->data)
|
||||||
->withSwiftMessage(function ($message) {
|
->withSwiftMessage(function ($message) {
|
||||||
|
@ -22,6 +22,7 @@ class ClientContactResetPasswordObject
|
|||||||
public $token;
|
public $token;
|
||||||
|
|
||||||
private $company;
|
private $company;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -52,12 +53,19 @@ class ClientContactResetPasswordObject
|
|||||||
'logo' => $this->company->present()->logo(),
|
'logo' => $this->company->present()->logo(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$email_from_name = config('mail.from.name');
|
||||||
|
|
||||||
|
if(property_exists($settings, 'email_from_name') && strlen($settings->email_from_name) > 1)
|
||||||
|
$email_from_name = $settings->email_from_name;
|
||||||
|
else
|
||||||
|
$email_from_name = $this->company->present()->name();
|
||||||
|
|
||||||
$mail_obj = new \stdClass;
|
$mail_obj = new \stdClass;
|
||||||
$mail_obj->subject = ctrans('texts.your_password_reset_link');
|
$mail_obj->subject = ctrans('texts.your_password_reset_link');
|
||||||
$mail_obj->data = $data;
|
$mail_obj->data = $data;
|
||||||
$mail_obj->markdown = 'email.client.generic';
|
$mail_obj->markdown = 'email.client.generic';
|
||||||
$mail_obj->tag = $this->company->company_key;
|
$mail_obj->tag = $this->company->company_key;
|
||||||
|
$mail_obj->from_name = $email_from_name;
|
||||||
|
|
||||||
return $mail_obj;
|
return $mail_obj;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user