- Issue created by @HitchShock
- @hitchshock opened merge request.
- Status changed to Needs review
8 months ago 3:10pm 5 November 2023 - Status changed to Closed: duplicate
8 months ago 4:33pm 7 November 2023 - π¬π§United Kingdom AdamPS
Thanks for the patch, however it's more complex than that. There can be a comma inside a display name.
Please see β¨ Add support for complex address strings in back-compatibility mode Active which this is a duplicate of.
- Status changed to Needs review
8 months ago 5:39pm 7 November 2023 - πΊπ¦Ukraine HitchShock Ukraine
@adamps
Nope, this is not the same one.
In #3350992 you are trying to fix the behavior for complex address strings there, but in general, the function MailerHelper::parseAddress() works already with comma-separated addresses, whereas the BaseEmailTrait::setAddress() function definitely does NOT, but should!That issue can take a long time to resolve, whereas this fix is simple and necessary and can be applied more quickly.
It's just that when discussing that issue, you need to be aware that there may be more than one place with such a problem. - Status changed to Closed: works as designed
8 months ago 1:53pm 8 November 2023 - π¬π§United Kingdom AdamPS
Ah thanks for explaining I understand now.
If you are using
BaseEmailInterface::setAddress()
then you should put each address in a separate array element. The function comment points toAddress::convert()
which says "Can be a single element or an array". It then refers on toAddress:create()
which says "string containing a single email address without display name".So this is working as designed. You can put the explode into your calling code, or even better avoid joining with comma in the first place.