-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
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
After update from laravel 5.5 to laravel 5.8 swiftmailers setBody method doesn
t make any changes to body
#28547
Comments
s setBody method doesn
t make any changes to body
This was the pr that made the change: #22995 to fix #22982 Since this is a case of wether it either breaks one or the other it's hard to consider this as a bug. I'd suggest that you either accommodate for this change or attempt another PR to change back to the previous behavior. But please try to provide a very thorough explanation why this should be a better way that the reasoning in #22995 |
I don't know how to very thorough explain this kind of issue. Alexander-- wants to modify encoder. He don`t care that his feature implementation ruins normal behavior of swiftmailer method. And can crash already built application on laravel version update... Maybe it would be better to add some flag "if you want a priority in developer-supplied callbacks workaround"? Or add some examples of alternative methods for solving this kind of problem in documentation? I mean "how can I send row mails and what to do if I want to modify body in callback function"... |
Hey @xUJYx. It's best that you post an issue in the ideas repo to get some feedback from other community members on this matter. Together you might figure out a good solution. Unfortunately I don't have the time myself to deep-dive into this at the moment. |
@driesvints Done. Thanks... |
That PR #22995 also breaks things here: In our case, we use the Our code is like
This used to work on 5.5, and now we are migrating to latest version, but after 5.6 the callback order rearrange causes this issue. I understand the reason of the rearrange, but I think that $this->withSwiftMessage() should be able to place a callback BEFORE and AFTER. Maybe, it can receive an optional parameter for placing it before. Can @taylorotwell give a look here? I think this is an important issue. |
Description:
After update laravel version from 5.5 to 5.8 when using swiftmailer raw method, mail sending starts to give error quoted_printable_encode() expects parameter 1 to be string, array given
If you provide some raw string data as first parameter - mail will be sent, BUT callback function will not make any changes to body with setBody method...
Steps To Reproduce:
Try to send e-mail with raw method using swiftmailer:
`Mail::raw([], function ($message)
{
$message->to('some@email.test');
$message->from('from@my.mail', 'MyName');
$message->subject('Test email send');
$message->setBody('Some cute html body to send', 'text/html');
});`
How To Solve Problem:
In new versions of laravel 5.6+ had been moved call of call_user_func in /vendor/laravel/framework/src/Illuminate/Mail/Mailer.php in send($view, array $data = [], $callback = null) method...
If you move call_user_func back as in previous laravel versions - problem will be solved and all will start work well.
Thats it...
The text was updated successfully, but these errors were encountered: