{"id":13617160,"url":"https://github.com/Stampie/Stampie","last_synced_at":"2025-04-14T03:33:04.807Z","repository":{"id":1940088,"uuid":"2869331","full_name":"Stampie/Stampie","owner":"Stampie","description":"Library for using online Email providers","archived":false,"fork":false,"pushed_at":"2022-06-27T14:00:24.000Z","size":1301,"stargazers_count":293,"open_issues_count":1,"forks_count":30,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-17T11:53:47.561Z","etag":null,"topics":["mailer","mailjet","mandrill","mandrill-api-wrapper","php","postmark","sendgrid","sparkpost","stampie"],"latest_commit_sha":null,"homepage":"https://stampie.github.io","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/Stampie.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-28T18:52:39.000Z","updated_at":"2025-01-22T19:49:43.000Z","dependencies_parsed_at":"2022-08-24T07:30:32.932Z","dependency_job_id":null,"html_url":"https://github.com/Stampie/Stampie","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stampie%2FStampie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stampie%2FStampie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stampie%2FStampie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stampie%2FStampie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stampie","download_url":"https://codeload.github.com/Stampie/Stampie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815758,"owners_count":21165977,"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":["mailer","mailjet","mandrill","mandrill-api-wrapper","php","postmark","sendgrid","sparkpost","stampie"],"created_at":"2024-08-01T20:01:37.590Z","updated_at":"2025-04-14T03:32:59.795Z","avatar_url":"https://github.com/Stampie.png","language":"PHP","funding_links":[],"categories":["PHP","目录","Code","Table of Contents","电子邮件 Email"],"sub_categories":["电子邮件 Email","Library","Email"],"readme":"# Stampie\n\n[![CI](https://github.com/Stampie/Stampie/actions/workflows/ci.yml/badge.svg)](https://github.com/Stampie/Stampie/actions/workflows/ci.yml)\n\nStampie is a simple API Wrapper for different email providers such as [Postmark](https://postmarkapp.com) and [SendGrid](https://sendgrid.com).\n\nIt is very easy to use and to integrate into your application as demonstrated below with a `SendGrid` mailer.\n\n## Providers\n\n* [Postmark](https://postmarkapp.com)\n* [SendGrid](https://sendgrid.com)\n* [MailGun](https://www.mailgun.com)\n* [Mandrill](https://mandrill.com/)\n* [SparkPost](https://sparkpost.com)\n* [Mailjet](https://www.mailjet.com)\n\n```php\n\u003c?php\n\n// composer autoloading.\nrequire 'vendor/autoload.php';\n\nclass Message extends \\Stampie\\Message\n{\n\tpublic function getFrom() { return 'alias@domain.tld'; }\n\tpublic function getSubject() { return 'You are trying out Stampie'; }\n\tpublic function getText() { return 'So what do you think about it?'; }\n}\n\n$adapter = new Http\\Adapter\\Guzzle6\\Client();\n$mailer = new Stampie\\Mailer\\SendGrid($adapter, 'username:password');\n\n// Throws an HttpException for error\n// messages not recognized by SendGrid api or ApiException for known errors.\n$mailer-\u003esend(new Message('reciever@domain.tld'));\n```\n\nThis simple example shows a few different things about how Stampie works under the hood and is developed. Because others\nare **so much** better than us to do HTTP communication, Stampie uses the [PSR-18](https://www.php-fig.org/psr/psr-18/) abstraction so\nyou are free to choose between any library like [Buzz](https://github.com/kriswallsmith/Buzz) or [Guzzle](https://docs.guzzlephp.org).\nSee the full list here: https://packagist.org/providers/psr/http-client-implementation\n\nEvery mailer takes a `$serverToken` as the second argument in their constructor. This is what is used for authentication.\nIn the Postmark mailer this is a hash but in SendGrid it is a `username:password` pattern that is split into two pieces\nand send as arguments. A mailer is responsible for formatting the request needed for a given API.\n\nA `Message` or `MessageInterface` is a simple storage class that holds information about the message sent to an API such \nas the email address this is from and who should receive it together with html and text bodies.\n\nLast there is an interface for every type of class or abstract implementation that should be used when adding new Mailer's\nor Adapter's.\n\n## Installation\n\nStampie is not hard coupled to Guzzle or any other library that sends HTTP messages. It uses an abstraction \ncalled PSR-18. This will give you the flexibility to choose what PSR-7 implementation and HTTP client to use.\n\nIf you just want to get started quickly you should run the following command: \n\n```bash\ncomposer require stampie/stampie php-http/curl-client nyholm/psr7\n```\n\n### Why requiring so many packages?\n\nStampie has a dependency on the virtual package [psr/http-client-implementation](https://packagist.org/providers/psr/http-client-implementation) \nwhich requires to you install **an** adapter, but we do not care which one. That is an implementation detail in your application. \nWe also need **a** [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation).\n\nYou do not have to use the `php-http/curl-client` if you do not want to. You may use the `php-http/guzzle6-adapter` or any\nother library in [this list](https://packagist.org/providers/psr/http-client-implementation).\n\n## Documentation\n\nThere is generated API documentation for all tags and released versions. Those can be found at [stampie.github.io/Stampie/api/main/](https://stampie.github.io/Stampie/api/main/).\n\n## Extensions\n\n* [Stampie Extra](https://github.com/Stampie/extra) provides extensions to Stampie using the Symfony EventDispatcher component.\n\n## Framework integration\n\nStampie is itself completely decoupled and does not depend on any framework.\n\n### Integrations\n\n* [StampieBundle](https://github.com/Stampie/stampie-bundle) it is also [on packagist](https://packagist.org/packages/stampie/stampie-bundle)\n\n## Testing\n\nStampie is [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) tested with GitHub Actions and aims for a high coverage percentage.\n\n## Developing\n\nAs mentioned above if integrating new mailers or adapters please rely on the interfaces or abstract classes already in this package. Furthermore unit tests should be provided as well.\n\n\n## Feedback\n\nThis is a project created to test TDD along the way and maybe have some scars from that. But you are always welcome to send feedback or GitHub, Twitter, GitHub issue or Pull Request. Same goes if something is wrong or you have ideas for a better or smarter implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStampie%2FStampie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStampie%2FStampie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStampie%2FStampie/lists"}