How to set mail from-name?
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to set mail from-name?
Hi,
I'm trying to set the mail "from-name" eg. for the payment mail
already set the correct name:
1. in .env MAIL_FROM_NAME
2. in config/mail.php:
'from' => [
'name' => '...',
],
3. and in config/shop.php
'email' => [
'from-name' => '...',
],
but this had no effect - why? what is missing or where else do I have to set the mail from-name?
Thank you
I'm trying to set the mail "from-name" eg. for the payment mail
already set the correct name:
1. in .env MAIL_FROM_NAME
2. in config/mail.php:
'from' => [
'name' => '...',
],
3. and in config/shop.php
'email' => [
'from-name' => '...',
],
but this had no effect - why? what is missing or where else do I have to set the mail from-name?
Thank you
Re: How to set mail from-name?
The used configurations are:
- https://github.com/aimeos/aimeos/blob/m ... hp#L93-L96
- https://github.com/aimeos/aimeos/blob/m ... #L137-L140
Essentially, they will use the MAIL_FROM_NAME configuration from the .env file if everything is correct.
- https://github.com/aimeos/aimeos/blob/m ... hp#L93-L96
- https://github.com/aimeos/aimeos/blob/m ... #L137-L140
Essentially, they will use the MAIL_FROM_NAME configuration from the .env file if everything is correct.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to set mail from-name?
I have double checked my settings and everything seems to be fine.
in .env MAIL_FROM_NAME='My company' is set, also in mail.php
FROM-NAME is still missing in payment mail source:
in .env MAIL_FROM_NAME='My company' is set, also in mail.php
FROM-NAME is still missing in payment mail source:
Re: How to set mail from-name?
The name is handed over but it may be that the Symfony mailer component doesn't use it:
https://github.com/aimeos/ai-controller ... il.php#L98
https://github.com/aimeos/ai-controller ... il.php#L98
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to set mail from-name?
ok - What is your suggestion to fix this?
Copying, overwriting from() (/vendor/aimeos/ai-laravel/src/Base/Mail/Message) and adding MAIL_FROM_NAME works, but do you have a better suggestion?
thank you
Copying, overwriting from() (/vendor/aimeos/ai-laravel/src/Base/Mail/Message) and adding MAIL_FROM_NAME works, but do you have a better suggestion?
Code: Select all
public function from( string $email, string $name = null ) : Iface
{
if( $email ) {
//$this->message->from( $email );
$this->message->from(new Address($email, env('MAIL_FROM_NAME')));
}
return $this;
}
Re: How to set mail from-name?
In that case, it's pretty easy and we've created a PR with the required changes. You can try yourself using:
Code: Select all
composer req aimeos/ai-laravel:2023.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to set mail from-name?
great - it works perfectly
thank you
thank you