Skip to content

Fix: save newsletter template#5285

Open
sreichel wants to merge 6 commits intoOpenMage:mainfrom
sreichel:newsletter
Open

Fix: save newsletter template#5285
sreichel wants to merge 6 commits intoOpenMage:mainfrom
sreichel:newsletter

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Mar 1, 2026

Description (*)

Cant save existing newsletter template b/c "template_type" has to be an integer value, string given.

  • added getter/setter
  • added save success message
  • added cypress test

Related Pull Requests

Manual testing scenarios (*)

  1. go to admnin - newsletter - template
  2. save an existing template

Copilot AI review requested due to automatic review settings March 1, 2026 15:12
@github-actions github-actions bot added Component: Core Relates to Mage_Core Component: Adminhtml Relates to Mage_Adminhtml Component: Newsletter Relates to Mage_Newsletter translations Relates to app/locale cypress labels Mar 1, 2026
@sreichel sreichel added the bug label Mar 1, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes saving existing newsletter templates by ensuring template_type is handled as an integer (matching validation expectations), and adds UI/test coverage for a successful save in the admin newsletter template editor.

Changes:

  • Add explicit getTemplateType()/setTemplateType() implementations in Mage_Newsletter_Model_Template to coerce template_type to int.
  • Add an admin session success message after saving a newsletter template.
  • Update Cypress e2e to cover saving an existing newsletter template and assert the success message.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cypress/e2e/openmage/backend/newsletter/template.cy.js Updates edit-route test to save an existing template and check for a success message.
app/locale/en_US/Mage_Newsletter.csv Adds a new translation string for the save success message.
app/code/core/Mage/Newsletter/Model/Template.php Introduces typed getter/setter for template_type to satisfy int validation.
app/code/core/Mage/Core/Model/Email/Template/Abstract.php Docblock updates for template text/type method annotations.
app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php Adds a save success message and returns immediately after redirect.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Component: Adminhtml Relates to Mage_Adminhtml Component: Core Relates to Mage_Core Component: Newsletter Relates to Mage_Newsletter cypress phpunit translations Relates to app/locale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants