Skip to content

Add AssociatedMailMessage for notification model association - #88

Merged
markvaneijk merged 1 commit into
mainfrom
feature/associated-mail-message-for-notifications
Mar 26, 2026
Merged

Add AssociatedMailMessage for notification model association#88
markvaneijk merged 1 commit into
mainfrom
feature/associated-mail-message-for-notifications

Conversation

@markvaneijk

Copy link
Copy Markdown
Contributor

Summary

  • Adds AssociatedMailMessage class extending MailMessage with a fluent associateModels() method for linking Eloquent models to emails sent via notifications
  • Reuses the existing X-Mails-Associated-Models header strategy so StoreMailRelations works unchanged — no changes to listeners, config, or migrations
  • Includes integration tests covering single model, multiple models, and no-models scenarios

Closes #71

Test plan

  • Send notification with AssociatedMailMessage + associateModels() → mail record + pivot records created
  • Multiple models associated correctly
  • Notification without associated models works without creating pivot records
  • Full test suite passes (41 tests)

🤖 Generated with Claude Code

…cations

Adds a new AssociatedMailMessage class extending MailMessage that provides
a fluent associateModels() method for notification flows. Reuses the existing
X-Mails-Associated-Models header strategy so StoreMailRelations works unchanged.

Closes #71

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@markvaneijk
markvaneijk merged commit 83a75d5 into main Mar 26, 2026
4 checks passed
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.

1 participant