{"id":34938939,"url":"https://github.com/phpnomad/email","last_synced_at":"2026-05-21T08:38:17.520Z","repository":{"id":244274175,"uuid":"788688147","full_name":"phpnomad/email","owner":"phpnomad","description":"Email strategy interfaces for sending mail through any backend","archived":false,"fork":false,"pushed_at":"2026-04-10T02:10:34.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-14T11:13:36.162Z","etag":null,"topics":["email","framework","mail","php","phpnomad","platform-agnostic"],"latest_commit_sha":null,"homepage":"https://phpnomad.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/phpnomad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-04-18T22:25:51.000Z","updated_at":"2026-04-10T02:10:38.000Z","dependencies_parsed_at":"2024-06-13T19:56:18.528Z","dependency_job_id":"2f7dea9c-de75-453c-9588-dbe62ef4b00d","html_url":"https://github.com/phpnomad/email","commit_stats":null,"previous_names":["phpnomad/email"],"tags_count":1,"template":false,"template_full_name":"phpnomad/repository-template","purl":"pkg:github/phpnomad/email","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Femail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Femail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Femail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Femail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpnomad","download_url":"https://codeload.github.com/phpnomad/email/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpnomad%2Femail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33294031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["email","framework","mail","php","phpnomad","platform-agnostic"],"created_at":"2025-12-26T18:49:06.850Z","updated_at":"2026-05-21T08:38:17.514Z","avatar_url":"https://github.com/phpnomad.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpnomad/email\n\n[![Latest Version](https://img.shields.io/packagist/v/phpnomad/email.svg)](https://packagist.org/packages/phpnomad/email)\n[![Total Downloads](https://img.shields.io/packagist/dt/phpnomad/email.svg)](https://packagist.org/packages/phpnomad/email)\n[![PHP Version](https://img.shields.io/packagist/php-v/phpnomad/email.svg)](https://packagist.org/packages/phpnomad/email)\n[![License](https://img.shields.io/packagist/l/phpnomad/email.svg)](https://packagist.org/packages/phpnomad/email)\n\n`phpnomad/email` defines the contract PHPNomad applications use to send transactional mail. It contains a single strategy interface, `EmailStrategy`, and a failure exception. Concrete sending lives in a separate integration package, so your application code depends on the contract rather than on a specific mailer. Swap the strategy in your bootstrapper and the rest of your code stays the same. The built-in implementation is [`phpnomad/php-mail-integration`](https://packagist.org/packages/phpnomad/php-mail-integration), which sends through PHP's `mail()` function. Anything else (SMTP, a third-party API, a queued background worker) drops in by writing another class that implements the interface.\n\n## Installation\n\n```bash\ncomposer require phpnomad/email\n```\n\nYou will also need a strategy implementation. Install `phpnomad/php-mail-integration` for the default, or provide your own class that implements `EmailStrategy`.\n\n## Quick Start\n\nInject `EmailStrategy` wherever you send mail, then call `send()` and handle `EmailSendFailedException`.\n\n```php\n\u003c?php\n\nnamespace MyApp\\Notifications;\n\nuse PHPNomad\\Email\\Exceptions\\EmailSendFailedException;\nuse PHPNomad\\Email\\Interfaces\\EmailStrategy;\n\nclass NotificationService\n{\n    public function __construct(protected EmailStrategy $emailStrategy)\n    {\n    }\n\n    public function notify(string $recipient, string $body): void\n    {\n        try {\n            $this-\u003eemailStrategy-\u003esend(\n                [$recipient],\n                'Your account is ready',\n                $body,\n                ['Content-Type: text/html; charset=UTF-8']\n            );\n        } catch (EmailSendFailedException $e) {\n            // Log and continue, or rethrow depending on your policy.\n        }\n    }\n}\n```\n\n## Overview\n\n- `EmailStrategy` interface with a single `send(array $to, string $subject, string $body, array $headers): void` method\n- `EmailSendFailedException` thrown by strategies when delivery fails\n- A backend-agnostic contract your application depends on instead of a specific mailer\n- Pairs with `phpnomad/php-mail-integration` for PHP's built-in `mail()` function, or any custom strategy you write\n\n## Documentation\n\nFull PHPNomad documentation is at [phpnomad.com](https://phpnomad.com).\n\n## License\n\nMIT. See [LICENSE.txt](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Femail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpnomad%2Femail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpnomad%2Femail/lists"}