From e2180133f94da55291ee888763c68ee88130d879 Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Thu, 7 Dec 2023 12:42:43 -0500 Subject: [PATCH] [Mailer] New Component and Contract (#189) ## Description ## Checklist - [ ] Updated CHANGELOG files - [ ] Updated Documentation - [ ] Unit Tests Created - [ ] php-cs-fixer --- .github/CODEOWNERS | 1 + .github/labeler.yml | 4 ++ bard.json | 8 +++ composer.json | 15 ++++-- docs/components/mailer/index.md | 11 ++++ docs/contracts/mailer/index.md | 9 ++++ mkdocs.yml | 2 + src/SonsOfPHP/Component/Mailer/.gitattributes | 4 ++ src/SonsOfPHP/Component/Mailer/.gitignore | 3 ++ src/SonsOfPHP/Component/Mailer/LICENSE | 19 +++++++ src/SonsOfPHP/Component/Mailer/README.md | 16 ++++++ src/SonsOfPHP/Component/Mailer/composer.json | 54 +++++++++++++++++++ src/SonsOfPHP/Contract/Mailer/.gitattributes | 2 + src/SonsOfPHP/Contract/Mailer/.gitignore | 2 + src/SonsOfPHP/Contract/Mailer/LICENSE | 19 +++++++ src/SonsOfPHP/Contract/Mailer/README.md | 16 ++++++ src/SonsOfPHP/Contract/Mailer/composer.json | 52 ++++++++++++++++++ 17 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 docs/components/mailer/index.md create mode 100644 docs/contracts/mailer/index.md create mode 100644 src/SonsOfPHP/Component/Mailer/.gitattributes create mode 100644 src/SonsOfPHP/Component/Mailer/.gitignore create mode 100644 src/SonsOfPHP/Component/Mailer/LICENSE create mode 100644 src/SonsOfPHP/Component/Mailer/README.md create mode 100644 src/SonsOfPHP/Component/Mailer/composer.json create mode 100644 src/SonsOfPHP/Contract/Mailer/.gitattributes create mode 100644 src/SonsOfPHP/Contract/Mailer/.gitignore create mode 100644 src/SonsOfPHP/Contract/Mailer/LICENSE create mode 100644 src/SonsOfPHP/Contract/Mailer/README.md create mode 100644 src/SonsOfPHP/Contract/Mailer/composer.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 27a3cc09..47caa7eb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -23,6 +23,7 @@ docs/ @JoshuaEstes /src/SonsOfPHP/**/Json @JoshuaEstes /src/SonsOfPHP/**/Link @JoshuaEstes /src/SonsOfPHP/**/Logger @JoshuaEstes +/src/SonsOfPHP/**/Mailer @JoshuaEstes /src/SonsOfPHP/**/Money @JoshuaEstes /src/SonsOfPHP/**/Pager @JoshuaEstes /src/SonsOfPHP/**/Version @JoshuaEstes diff --git a/.github/labeler.yml b/.github/labeler.yml index d666764d..e0ece348 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -66,6 +66,10 @@ Logger: - docs/components/logger/* - src/SonsOfPHP/**/Logger/* +Mailer: + - docs/components/mailer/* + - src/SonsOfPHP/**/Mailer/* + Money: - docs/components/money/* - src/SonsOfPHP/**/Money/* diff --git a/bard.json b/bard.json index 2a13bfc4..d70c02bc 100644 --- a/bard.json +++ b/bard.json @@ -5,6 +5,14 @@ "path": "src/SonsOfPHP/Bard", "repository": "git@github.com:SonsOfPHP/bard.git" }, + { + "path": "src/SonsOfPHP/Contract/Mailer", + "repository": "git@github.com:SonsOfPHP/mailer-contract.git" + }, + { + "path": "src/SonsOfPHP/Component/Mailer", + "repository": "git@github.com:SonsOfPHP/mailer.git" + }, { "path": "src/SonsOfPHP/Component/Cache", "repository": "git@github.com:SonsOfPHP/cache.git" diff --git a/composer.json b/composer.json index 63f6baba..cf9d1765 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,8 @@ "psr/container-implementation": "^1.0 || ^2.0", "psr/http-server-handler-implementation": "^1.0", "psr/http-server-middleware-implementation": "^1.0", - "sonsofphp/http-handler-implementation": "0.3.x-dev" + "sonsofphp/http-handler-implementation": "0.3.x-dev", + "sonsofphp/mailer-implementation": "0.3.x-dev" }, "require": { "php": ">=8.1", @@ -123,11 +124,15 @@ "sonsofphp/cookie-contract": "self.version", "sonsofphp/container": "self.version", "sonsofphp/http-handler": "self.version", - "sonsofphp/http-handler-contract": "self.version" + "sonsofphp/http-handler-contract": "self.version", + "sonsofphp/mailer-contract": "self.version", + "sonsofphp/mailer": "self.version" }, "autoload": { "psr-4": { "SonsOfPHP\\Bard\\": "src/SonsOfPHP/Bard/src", + "SonsOfPHP\\Contract\\Mailer\\": "src/SonsOfPHP/Contract/Mailer", + "SonsOfPHP\\Component\\Mailer\\": "src/SonsOfPHP/Component/Mailer", "SonsOfPHP\\Component\\Cache\\": "src/SonsOfPHP/Component/Cache", "SonsOfPHP\\Component\\Clock\\": "src/SonsOfPHP/Component/Clock", "SonsOfPHP\\Component\\Container\\": "src/SonsOfPHP/Component/Container", @@ -168,6 +173,7 @@ }, "exclude-from-classmap": [ "src/SonsOfPHP/Bard/Tests", + "src/SonsOfPHP/Component/Mailer/Tests", "src/SonsOfPHP/Component/Cache/Tests", "src/SonsOfPHP/Component/Clock/Tests", "src/SonsOfPHP/Component/Container/Tests", @@ -209,8 +215,7 @@ "symfony/error-handler": "^6", "symfony/messenger": "^5 || ^6", "phpunit/phpunit": "^10.4", - "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", - "sonsofphp/http-message": "0.3.x-dev" + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "autoload-dev": { "psr-4": { @@ -219,4 +224,4 @@ "SonsOfPHP\\Bridge\\Symfony\\Cqrs\\Tests\\": "src/SonsOfPHP/Bridge/Symfony/Cqrs/Tests" } } -} \ No newline at end of file +} diff --git a/docs/components/mailer/index.md b/docs/components/mailer/index.md new file mode 100644 index 00000000..b1b1efc0 --- /dev/null +++ b/docs/components/mailer/index.md @@ -0,0 +1,11 @@ +--- +title: Mailer +--- + +Simple PHP Mailer + +## Installation + +```shell +composer require sonsofphp/mailer +``` diff --git a/docs/contracts/mailer/index.md b/docs/contracts/mailer/index.md new file mode 100644 index 00000000..dff51e6e --- /dev/null +++ b/docs/contracts/mailer/index.md @@ -0,0 +1,9 @@ +--- +title: Mailer Contract +--- + +## Installation + +```shell +composer require sonsofphp/mailer-contract +``` diff --git a/mkdocs.yml b/mkdocs.yml index 193d6276..74519622 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -111,6 +111,7 @@ nav: - JSON: components/json/index.md - Link: components/link/index.md - Logger: components/logger/index.md + - Mailer: components/mailer/index.md - Money: - Overview: components/money/index.md - Currency Providers: components/money/currency-providers.md @@ -123,4 +124,5 @@ nav: - Common: contracts/common/index.md - Cookie: contracts/cookie/index.md - Cqrs: contracts/cqrs/index.md + - Mailer: contracts/mailer/index.md - Pager: contracts/pager/index.md diff --git a/src/SonsOfPHP/Component/Mailer/.gitattributes b/src/SonsOfPHP/Component/Mailer/.gitattributes new file mode 100644 index 00000000..84c7add0 --- /dev/null +++ b/src/SonsOfPHP/Component/Mailer/.gitattributes @@ -0,0 +1,4 @@ +/Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore diff --git a/src/SonsOfPHP/Component/Mailer/.gitignore b/src/SonsOfPHP/Component/Mailer/.gitignore new file mode 100644 index 00000000..5414c2c6 --- /dev/null +++ b/src/SonsOfPHP/Component/Mailer/.gitignore @@ -0,0 +1,3 @@ +composer.lock +phpunit.xml +vendor/ diff --git a/src/SonsOfPHP/Component/Mailer/LICENSE b/src/SonsOfPHP/Component/Mailer/LICENSE new file mode 100644 index 00000000..39238382 --- /dev/null +++ b/src/SonsOfPHP/Component/Mailer/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 to Present Joshua Estes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SonsOfPHP/Component/Mailer/README.md b/src/SonsOfPHP/Component/Mailer/README.md new file mode 100644 index 00000000..4662eb3f --- /dev/null +++ b/src/SonsOfPHP/Component/Mailer/README.md @@ -0,0 +1,16 @@ +Sons of PHP - Mailer +==================== + +## Learn More + +* [Documentation][docs] +* [Contributing][contributing] +* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the [Mother Repository][mother-repo] +* Get Help & Support using [Discussions][discussions] + +[discussions]: https://github.com/orgs/SonsOfPHP/discussions +[mother-repo]: https://github.com/SonsOfPHP/sonsofphp +[contributing]: https://docs.sonsofphp.com/contributing/ +[docs]: https://docs.sonsofphp.com/components/mailer/ +[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3AMailer +[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3AMailer diff --git a/src/SonsOfPHP/Component/Mailer/composer.json b/src/SonsOfPHP/Component/Mailer/composer.json new file mode 100644 index 00000000..477553d9 --- /dev/null +++ b/src/SonsOfPHP/Component/Mailer/composer.json @@ -0,0 +1,54 @@ +{ + "name": "sonsofphp/mailer", + "type": "library", + "description": "", + "keywords": [ + "mailer" + ], + "homepage": "https://github.com/SonsOfPHP/mailer", + "license": "MIT", + "authors": [ + { + "name": "Joshua Estes", + "email": "joshua@sonsofphp.com" + } + ], + "support": { + "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", + "forum": "https://github.com/orgs/SonsOfPHP/discussions", + "docs": "https://docs.sonsofphp.com" + }, + "autoload": { + "psr-4": { + "SonsOfPHP\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.1", + "sonsofphp/mailer-contract": "0.3.x-dev" + }, + "provide": { + "sonsofphp/mailer-implementation": "0.3.x-dev" + }, + "extra": { + "sort-packages": true, + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/JoshuaEstes" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" + } + ] +} \ No newline at end of file diff --git a/src/SonsOfPHP/Contract/Mailer/.gitattributes b/src/SonsOfPHP/Contract/Mailer/.gitattributes new file mode 100644 index 00000000..3a01b372 --- /dev/null +++ b/src/SonsOfPHP/Contract/Mailer/.gitattributes @@ -0,0 +1,2 @@ +/.gitattributes export-ignore +/.gitignore export-ignore diff --git a/src/SonsOfPHP/Contract/Mailer/.gitignore b/src/SonsOfPHP/Contract/Mailer/.gitignore new file mode 100644 index 00000000..d8a7996a --- /dev/null +++ b/src/SonsOfPHP/Contract/Mailer/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor/ diff --git a/src/SonsOfPHP/Contract/Mailer/LICENSE b/src/SonsOfPHP/Contract/Mailer/LICENSE new file mode 100644 index 00000000..39238382 --- /dev/null +++ b/src/SonsOfPHP/Contract/Mailer/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 to Present Joshua Estes + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/SonsOfPHP/Contract/Mailer/README.md b/src/SonsOfPHP/Contract/Mailer/README.md new file mode 100644 index 00000000..db89e21a --- /dev/null +++ b/src/SonsOfPHP/Contract/Mailer/README.md @@ -0,0 +1,16 @@ +Sons of PHP - Mailer Contract +============================= + +## Learn More + +* [Documentation][docs] +* [Contributing][contributing] +* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the [Mother Repository][mother-repo] +* Get Help & Support using [Discussions][discussions] + +[discussions]: https://github.com/orgs/SonsOfPHP/discussions +[mother-repo]: https://github.com/SonsOfPHP/sonsofphp +[contributing]: https://docs.sonsofphp.com/contributing/ +[docs]: https://docs.sonsofphp.com/contracts/mailer/ +[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3AMailer +[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3AMailer diff --git a/src/SonsOfPHP/Contract/Mailer/composer.json b/src/SonsOfPHP/Contract/Mailer/composer.json new file mode 100644 index 00000000..1bff7fec --- /dev/null +++ b/src/SonsOfPHP/Contract/Mailer/composer.json @@ -0,0 +1,52 @@ +{ + "name": "sonsofphp/mailer-contract", + "type": "library", + "description": "", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "homepage": "https://github.com/SonsOfPHP/mailer-contract", + "license": "MIT", + "authors": [ + { + "name": "Joshua Estes", + "email": "joshua@sonsofphp.com" + } + ], + "support": { + "issues": "https://github.com/SonsOfPHP/sonsofphp/issues", + "forum": "https://github.com/orgs/SonsOfPHP/discussions", + "docs": "https://docs.sonsofphp.com" + }, + "autoload": { + "psr-4": { + "SonsOfPHP\\Contract\\Mailer\\": "" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require": { + "php": ">=8.1" + }, + "extra": { + "sort-packages": true, + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/JoshuaEstes" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp" + } + ] +} \ No newline at end of file