You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create new mailable.
Set subject line to an empty string, null or false (all of which would indicate no subject line is desired).
Send mailable.
Subject line is set to the name of the mailable child class.
Further Details:
The problem occurs with the 'buildSubject' method on the 'Mailable' class. This method, helpfully, tries to ensure a subject line by checking if the subject property is 'truthy'. Unfortunately there are cases where a subject line may not be desirable, such as when using a provider which allows the sending of templates (and overriding the template subject line is also allowed).
A simple, additional, check that the subject property is not set to false (I think false is best but some other value might work too) would do it, just so users have the option to send an empty subject line.
This discussion was converted from issue #38996 on September 27, 2021 21:11.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Cannot set mailable subject line to nothing.
Steps To Reproduce:
Create new mailable.
Set subject line to an empty string, null or false (all of which would indicate no subject line is desired).
Send mailable.
Subject line is set to the name of the mailable child class.
Further Details:
The problem occurs with the 'buildSubject' method on the 'Mailable' class. This method, helpfully, tries to ensure a subject line by checking if the subject property is 'truthy'. Unfortunately there are cases where a subject line may not be desirable, such as when using a provider which allows the sending of templates (and overriding the template subject line is also allowed).
A simple, additional, check that the subject property is not set to false (I think false is best but some other value might work too) would do it, just so users have the option to send an empty subject line.
Beta Was this translation helpful? Give feedback.
All reactions