https://github.com/roundpartner/mail-service
Service for email transactions
https://github.com/roundpartner/mail-service
email-transactions mailgun-php php
Last synced: about 19 hours ago
JSON representation
Service for email transactions
- Host: GitHub
- URL: https://github.com/roundpartner/mail-service
- Owner: roundpartner
- Created: 2016-02-19T13:31:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T17:26:26.000Z (over 8 years ago)
- Last Synced: 2025-03-03T01:31:44.827Z (over 1 year ago)
- Topics: email-transactions, mailgun-php, php
- Language: PHP
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/roundpartner/mail-service)
# Mail Service
A service for sending email transactions.
## Initialising
The factory method uses MailGun service by default which requires an api key and an endpoint
```php
$service = new \MailService\MailServiceFactory($key, $endpoint);
```
## Sending Mail
```php
$service = new \MailService\MailServiceFactory($key, $endpoint);
$service->sendMessage($postData);
```
## Testing
Mailguns api is mocked to allow for testing of this services functionality.
```bash
vendor/bin/phpunit
```
## Plugins
Any plugin can be used as long as they implement the MailServiceInterface interface and placed inside the plugin directory.
The plugin can be loaded by setting the plugin variable in the configuration
```php
$config = new Configuration();
$config->plugin = 'MyCustomPlugin';
return new MailService($config);
```
## Clean Code
```bash
vendor/bin/phpcbf --standard=psr2 ./src
```