carlonicora / minimalism-service-mailer
Mailer service for minimalism
Requires
- php: >=8.0
- carlonicora/minimalism: ~13.0
- phpmailer/phpmailer: ~6.2
- sendgrid/sendgrid: ~7.9
- twig/twig: ~3.1
README
minimalism-service-mailer is a service for minimalism to send emails. It currently supports either mandrillapp or sendgrid.
Getting Started
To use this library, you need to have an application using minimalism. This library does not work outside this scope.
Prerequisite
You should have read the minimalism documentation and understand the concepts of services in the framework.
Installing
Require this package, with Composer, in the root directory of your project.
$ composer require carlonicora/minimalism-service-mailer
or simply add the requirement in composer.json
{ "require": { "carlonicora/minimalism-service-mailer": "~1.0" } }
Deployment
One important difference between other minimalism sevices and minimalism-service-mailer is that the latter does not
return a mailer class from the ServicesFactory, but a mailerServiceInterface
. The service automatically returns the
correct class depending on the required configuration (mandrillapp or sendgrid).
This service requires you to set up two parameters in your .env
file in order to send email.
Required parameters
#the mailing service password or private key
MINIMALISM_SERVICE_MAILER_PASSWORD=
Optional parameters
#defines the type of services to use. Currently supported are `mandrillapp' and 'sendgrid`. It defaults to `mandrillapp`
MINIMALISM_SERVICE_MAILER_TYPE=
#the username used to connect to the service. Not required if the service use a private key
MINIMALISM_SERVICE_MAILER_USERNAME=
#default sender email address
MINIMALISM_SERVICE_MAILER_SENDER_EMAIL=
#default sender name
MINIMALISM_SERVICE_MAILER_SENDER_NAME=
Build With
- minimalism - minimal modular PHP MVC framework
- phpmailer/phpmailer
- sendgrid/sendgrid
Versioning
This project use Semantiv Versioning for its tags.
Authors
License
This project is licensed under the MIT license - see the LICENSE.md file for details