{"id":28203523,"url":"https://github.com/modernmcguire/mailspy","last_synced_at":"2025-06-10T12:32:06.370Z","repository":{"id":225026050,"uuid":"764890220","full_name":"modernmcguire/mailspy","owner":"modernmcguire","description":"MailSpy is a Laravel package that allows you to capture and inspect emails sent by your application.","archived":false,"fork":false,"pushed_at":"2025-05-12T08:41:05.000Z","size":87,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-12T09:58:49.403Z","etag":null,"topics":["debug","laravel","logging","logs","mail","retention"],"latest_commit_sha":null,"homepage":"https://modernmcguire.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modernmcguire.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ModernMcGuire"}},"created_at":"2024-02-28T22:28:35.000Z","updated_at":"2025-05-12T08:41:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd2b9581-eae3-4739-8f63-92959ea3f949","html_url":"https://github.com/modernmcguire/mailspy","commit_stats":null,"previous_names":["modernmcguire/mailspy"],"tags_count":11,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernmcguire%2Fmailspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernmcguire%2Fmailspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernmcguire%2Fmailspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernmcguire%2Fmailspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modernmcguire","download_url":"https://codeload.github.com/modernmcguire/mailspy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modernmcguire%2Fmailspy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259075765,"owners_count":22801636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","laravel","logging","logs","mail","retention"],"created_at":"2025-05-17T02:09:37.385Z","updated_at":"2025-06-10T12:32:06.359Z","avatar_url":"https://github.com/modernmcguire.png","language":"PHP","funding_links":["https://github.com/sponsors/ModernMcGuire"],"categories":[],"sub_categories":[],"readme":"# MailSpy\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/modernmcguire/mailspy.svg?style=flat-square)](https://packagist.org/packages/modernmcguire/mailspy)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/modernmcguire/mailspy/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/modernmcguire/mailspy/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/modernmcguire/mailspy/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/modernmcguire/mailspy/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/modernmcguire/mailspy.svg?style=flat-square)](https://packagist.org/packages/modernmcguire/mailspy)\n\nMailSpy is a Laravel package that allows you to capture and inspect emails sent by your application. It was created to help with testing and debugging email sending in Laravel applications in addition to getting around low retention log limits in services like MailGun and MailerSend.\n\n---\n\nDo you want to fully capture your emails as an alternative to the log driver? Try out [MailThief](https://github.com/modernmcguire/mailthief).\n\n---\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require modernmcguire/mailspy\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"mailspy-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"mailspy-config\"\n```\n\n## Usage\n\nNothing to do here! Simply install the package and we will start tracking outgoing email saving the results to your database.\n\n## Events\n\nMailSpy listens for the MessageSending and MessageSent events.\nYou may register your own event listeners by calling the `Mailspy::sending()` and `Mailspy::sent()` methods in a service provider.\n\n```php\nuse ModernMcGuire\\MailSpy\\Facades\\MailSpy;\nuse \\Illuminate\\Mail\\Events\\MessageSending;\nuse \\Illuminate\\Mail\\Events\\MessageSent;\n\nMailSpy::sending(function (MessageSending $event, Email $email) {\n    // Do something with the event\n});\n\nMailSpy::sent(function (MessageSent $event, Email $email) {\n    // Do something with the event\n});\n```\n\n\n## Tags\n\nIf you want to tag your emails, you can do so by adding the `MailspyTags` concern to any of your mailable classes.\n\n```php\nuse ModernMcGuire\\MailSpy\\Facades\\MailSpy;\nuse ModernMcGuire\\MailSpy\\Traits\\MailspyTags;\n\nclass MarketingPlan extends Mailable implements ShouldQueue\n{\n    use Queueable;\n    use SerializesModels;\n    use MailspyTags;\n\n    /**\n     * Create a new message instance.\n     *\n     * @return void\n     */\n    public function __construct(\n        public Client $client,\n    ) {\n        //\n    }\n\n\n    public function tags(): array\n    {\n        return [\n            'client' =\u003e $this-\u003eclient-\u003eid,\n        ];\n    }\n\n}\n\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Ben Miller](https://github.com/modernben)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernmcguire%2Fmailspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodernmcguire%2Fmailspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernmcguire%2Fmailspy/lists"}