Skip to content
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

Check if email subject set in closure #1665

Closed
wants to merge 2 commits into from
Closed

Check if email subject set in closure #1665

wants to merge 2 commits into from

Conversation

BOOMER74
Copy link
Contributor

If subject setted in template, changing in closure like:

Mail::queue("template", [], function ($message) use ($subject, $email) {
$message->subject($subject)->to($email);
});

has no effect.

If subject setted in template, changing in closure like:

Mail::queue("template", [], function ($message) use ($subject, $email) {
	$message->subject($subject)->to($email);
});

has no effect.
daftspunk added a commit to octobercms/library that referenced this pull request Jan 2, 2016
daftspunk added a commit that referenced this pull request Jan 2, 2016
@daftspunk
Copy link
Member

Merged in 922cf30

Thanks

@daftspunk daftspunk closed this Jan 2, 2016
daftspunk added a commit to octoberrain/system that referenced this pull request Jan 2, 2016
LukeTowers pushed a commit to octoberrain/system that referenced this pull request Apr 20, 2019
LukeTowers added a commit to octobercms/library that referenced this pull request Oct 5, 2019
Accomplishes this by firing the message callback before content is added to the message.

This fixes an issue where subjects set on the message object through the callback were not able to override a mail template's subject as they're supposed to in System\Classes\MailManager because the callback was called after the MailManager's listener for mailer.beforeAddContent had already fired. The original issue was reported and fixed in octobercms/october#1665. However, that fix was then later broken by f409ad4 which was for the L5.5 upgrade in Build 420. It's also worth noting that Laravel has moved the callback to be before the content is added starting in L5.6, so this change also brings us closer in line with Laravel for the future 6.0 upgrade (see laravel/framework#22995 for that commit and background information).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants