Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make dynamic subjects available to mail templates
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).
- Loading branch information
8199817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukeTowers This introduced a new bug: when doing Mail::queue the mail in the view is now ignored, and instead the subject of the mail is Mailable. Mail::send works, but Mail::queue is broken. Is there something i can do on my own to fix as a production website I maintain is sending wrong subjects.