feat: populate mail_class column from Mailable data - #75
Merged
Conversation
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 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. |
Contributor
Author
|
Good one #80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$event->data['__laravel_mailable'](provided by Laravel'sMailable::additionalMessageData()) to populate themail_classcolumn when logging mailsscopeForUuidandscopeForMailClassquery scopes declared in the model's docblockTest plan
mail_classis stored as the FQCN (e.g.App\Mail\OrderConfirmation)Mail::send()with a closure and verifymail_classisnullMail::forMailClass('App\Mail\OrderConfirmation')query scope works🤖 Generated with Claude Code