Closed chiragchhatrala closed 3 weeks ago
The changes in this pull request involve significant modifications to the FormEmailNotification
class and its associated test suite. The formattedData
property has been removed, with its functionality replaced by a revised formatSubmissionData()
method that includes a new boolean parameter for conditional link creation. The email handling logic has been updated to utilize the creator's email from the event context. Additionally, the test suite has been enhanced with new test cases and updates to existing ones to improve coverage regarding email notifications and reply address handling.
File | Change Summary |
---|---|
api/app/Notifications/Forms/FormEmailNotification.php |
- Removed formattedData property.- Updated formatSubmissionData() to accept a new boolean parameter $createLinks .- Modified toMail() to use event creator's email.- Simplified getReplyToEmail() method.- Updated getMailData() and getEmailContent() to use formatSubmissionData() . - Removed getRespondentEmail() method. |
api/tests/Feature/Forms/EmailNotificationTest.php |
- Added new test case: send email with mention as reply to .- Added new test case: send email with empty reply to .- Updated existing test case: send email with the submitted data to assert replyTo field. |
sequenceDiagram
participant User
participant NotificationService
participant EmailService
User->>NotificationService: Trigger email notification
NotificationService->>EmailService: Prepare email using formatSubmissionData(createLinks=false)
EmailService-->>NotificationService: Email prepared with creator's email
NotificationService-->>User: Email sent confirmation
🐰 "In the garden of code, changes bloom bright,
With emails now clear, and links shining light.
FromformattedData
, we’ve taken a leap,
To handle replies, our logic runs deep.
So hop with delight, let notifications sing,
For every new feature, joy it will bring!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes
Tests