Repository navigation
Give the API test emails a usable body - #358
Conversation
CampaignsTest creates its email with a 'body' key, which is not an email API property and is silently ignored, so the published email carries no content at all. MessagesTest creates the email channel with name and subject only. Use customHtml in both fixtures so the emails describe a real sendable email, as EmailsTest already does. Refs mautic/mautic#17006, which validates on create/update that an active email has HTML or plain-text content; these fixtures then describe what they were always meant to describe.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for merging this, and for adding me to the contributors list. For the record: I closed it by mistake during a repository cleanup on my side, and you were right to reopen it - the change is small and the test is the whole point of it. |
|
Hey, busy week here. I didn't get to this notification in time. If you don't mind I'll reopen and merge. |
escopecz
left a comment
There was a problem hiding this comment.
Good change. Just tests, no production file change.
|
@all-contributors please add @santhiprakash for code |
|
I've put up a pull request to add @santhiprakash! 🎉 |
Two fixtures create published emails that carry no body content at all:
CampaignsTestpassesbodyin its email payload.bodyis not anemail API property (the API exposes
customHtml,plainText,template), so it is silently ignored and the created email has nocontent.
MessagesTestcreates the email channel with onlynameandsubjectset.Both emails end up published with no HTML, no plain text and no theme —
a state that no longer validates once mautic/mautic#17006 lands, where
an active email must have HTML or plain-text content and the error
surfaces through the regular API validation response.
The fix uses
customHtml, the same fieldEmailsTestalready uses, sothe fixtures describe the sendable email they were always meant to
create. Verified:
customHtmlis listed inEmail::loadApiMetadata()whilebodyis not, and the change is ano-op on current Mautic where no such validation exists yet.
Summary by CodeRabbit
customHtmlinstead ofbodywhere applicable.