-
Notifications
You must be signed in to change notification settings - Fork 301
feat: describe how to set mail data via subscriber #1887
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
Conversation
9b6c9de to
293ff6c
Compare
Isengo1989
left a comment
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.
Thx for the PR @ROBJkE - please check the Copilot comments. As it mentions this can be misleading in terms of overriding the whole template.
Consider using smth like this instead and briefly explain the diff between the two, or just leave setTemplateData out. If you are not modifying existing data, this can be removed.
$templateData = $event->getTemplateData();
// Add custom data
$templateData['customValue'] = 'some data';
// Set the modified template data
$event->setTemplateData($templateData);
|
Added inline comments, removed unnecessary constructor, removed |
9a91873 to
12425cd
Compare
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.
Pull Request Overview
This PR extends the "Add Data to Mails" guide by adding documentation for an alternative approach to add mail data using event subscribers instead of service decoration. The guide now provides two methods for customizing mail data in Shopware plugins.
- Reformatted existing code examples to use code groups for better presentation
- Added a new section documenting how to use event subscribers for mail data manipulation
- Updated code formatting and template syntax for improved readability
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Isengo1989
left a comment
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.
Thank you for the PR @ROBJkE 🥇
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Extend 'Add Data to Mails' guide