We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When calling setTo($to), if $to is of User[], it will throw "Array to string conversion" error
setTo($to)
$message = new \craft\mail\Message(); $to = User::findAll(); $message->setTo($to); $message->setSubject("Test"); $message->setHtmlBody("Hello World");
I think the reason being the Swiftmailer will expect $to to be ['[email protected]'=>'Person 1', '[email protected]'=>'Person 2'] instead of [['[email protected]'=>'Person 1'],[ '[email protected]'=>'Person 2']]
['[email protected]'=>'Person 1', '[email protected]'=>'Person 2']
[['[email protected]'=>'Person 1'],[ '[email protected]'=>'Person 2']]
The text was updated successfully, but these errors were encountered:
Fix _normalizeEmails($emails)
95e1a28
Fix an issue preventing passing User[] as $emails. This is related to issue craftcms#4048
aaf0753
Thanks for pointing that out, it’s been fixed for the next release.
Sorry, something went wrong.
No branches or pull requests
Description
When calling
setTo($to)
, if $to is of User[], it will throw "Array to string conversion" errorSteps to reproduce
Additional info
I think the reason being the Swiftmailer will expect $to to be
['[email protected]'=>'Person 1', '[email protected]'=>'Person 2']
instead of[['[email protected]'=>'Person 1'],[ '[email protected]'=>'Person 2']]
The text was updated successfully, but these errors were encountered: