Skip to content

Conversation

@ROBJkE
Copy link
Contributor

@ROBJkE ROBJkE commented Aug 2, 2025

Extend 'Add Data to Mails' guide

@ROBJkE ROBJkE marked this pull request as ready for review August 2, 2025 14:47
@bojanrajh bojanrajh requested a review from Isengo1989 August 4, 2025 06:52
@ROBJkE ROBJkE force-pushed the mail-data-via-subscriber branch from 9b6c9de to 293ff6c Compare August 11, 2025 14:13
@Isengo1989 Isengo1989 requested a review from Copilot August 13, 2025 14:52

This comment was marked as outdated.

Copy link
Contributor

@Isengo1989 Isengo1989 left a 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);

@ROBJkE
Copy link
Contributor Author

ROBJkE commented Aug 15, 2025

Added inline comments, removed unnecessary constructor, removed setTemplateData() example as it could be misleading

@Isengo1989 Isengo1989 force-pushed the mail-data-via-subscriber branch from 9a91873 to 12425cd Compare August 19, 2025 09:10
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

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
Isengo1989 previously approved these changes Aug 19, 2025
Copy link
Contributor

@Isengo1989 Isengo1989 left a 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>
@Isengo1989 Isengo1989 self-requested a review August 19, 2025 09:21
@Isengo1989 Isengo1989 merged commit 4296168 into shopware:main Aug 19, 2025
6 checks passed
@ROBJkE ROBJkE deleted the mail-data-via-subscriber branch August 19, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants