Skip to content

feat: populate mail_class column from Mailable data - #75

Merged
markvaneijk merged 2 commits into
mainfrom
feature/fill-mail-class-column
Mar 24, 2026
Merged

feat: populate mail_class column from Mailable data#75
markvaneijk merged 2 commits into
mainfrom
feature/fill-mail-class-column

Conversation

@markvaneijk

Copy link
Copy Markdown
Contributor

Summary

  • Read $event->data['__laravel_mailable'] (provided by Laravel's Mailable::additionalMessageData()) to populate the mail_class column when logging mails
  • Add missing scopeForUuid and scopeForMailClass query scopes declared in the model's docblock

Test plan

  • Send a mail using a Mailable class and verify mail_class is stored as the FQCN (e.g. App\Mail\OrderConfirmation)
  • Send a mail using Mail::send() with a closure and verify mail_class is null
  • Verify Mail::forMailClass('App\Mail\OrderConfirmation') query scope works

🤖 Generated with Claude Code

markvaneijk and others added 2 commits March 24, 2026 20:51
Laravel's Mailable class already provides the FQCN via
$event->data['__laravel_mailable']. Read this value in LogMail
instead of the commented-out nonexistent method.

Also adds the missing scopeForUuid and scopeForMailClass query
scopes that were declared in the model's docblock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@markvaneijk
markvaneijk merged commit 3117aaa into main Mar 24, 2026
@markvaneijk
markvaneijk deleted the feature/fill-mail-class-column branch March 24, 2026 19:55
@LukeTowers

Copy link
Copy Markdown

@markvaneijk FYI it looks like claude didn't add any tests to make sure that it was accurately logging the mailable class that was used to send the email.

@markvaneijk

Copy link
Copy Markdown
Contributor Author

Good one #80

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