diff --git a/CHANGELOG.md b/CHANGELOG.md index fb217ce..9acd8e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ `sendTemplate` methods. - `getScheduledMessages`, `cancelScheduledMessage` and `rescheduleMessage` methods have been also added to the Mandrill service to handle those messages. +- AlphaMail is dead and no longer operates. It is therefore removed from SlmMail. ## 1.4.1 diff --git a/README.md b/README.md index 9f55e8a..bb28ce3 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ or MailJet) are out-of-the scope of this module. Here are the currently supported services: -* [AlphaMail](http://www.amail.io) (complete) * [Amazon SES](http://aws.amazon.com/ses) (nearly complete, [attachments are missing](https://github.com/juriansluiman/SlmMail/issues/44)) * [Elastic Email](http://elasticemail.com) (complete) * [Mailgun](http://www.mailgun.com) (complete) @@ -75,7 +74,6 @@ Documentation Documentation for SlmMail is splitted for each provider: -* [AlphaMail](/docs/AlphaMail.md) * [Amazon SES](/docs/Ses.md) * [Elastic Email](/docs/ElasticEmail.md) * [Mailgun](/docs/Mailgun.md) diff --git a/composer.json b/composer.json index d24b0d6..3f66afa 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,6 @@ "keywords": [ "zf2", "email", - "alpha mail", - "alphamail", "elastic email", "elasticemail", "mailgun", diff --git a/config/module.config.php b/config/module.config.php index 2e06b4a..22c5e95 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -44,7 +44,6 @@ /** * Transport */ - 'SlmMail\Mail\Transport\AlphaMailTransport' => 'SlmMail\Factory\AlphaMailTransportFactory', 'SlmMail\Mail\Transport\ElasticEmailTransport' => 'SlmMail\Factory\ElasticEmailTransportFactory', 'SlmMail\Mail\Transport\MailgunTransport' => 'SlmMail\Factory\MailgunTransportFactory', 'SlmMail\Mail\Transport\MandrillTransport' => 'SlmMail\Factory\MandrillTransportFactory', @@ -56,7 +55,6 @@ /** * Services */ - 'SlmMail\Service\AlphaMailService' => 'SlmMail\Factory\AlphaMailServiceFactory', 'SlmMail\Service\ElasticEmailService' => 'SlmMail\Factory\ElasticEmailServiceFactory', 'SlmMail\Service\MailgunService' => 'SlmMail\Factory\MailgunServiceFactory', 'SlmMail\Service\MandrillService' => 'SlmMail\Factory\MandrillServiceFactory', diff --git a/config/slm_mail.alpha_mail.local.php.dist b/config/slm_mail.alpha_mail.local.php.dist deleted file mode 100644 index cc36eca..0000000 --- a/config/slm_mail.alpha_mail.local.php.dist +++ /dev/null @@ -1,12 +0,0 @@ - array( - 'alpha_mail' => array( - /** - * Set your AlphaMail API key - */ - // 'key' => '' - ) - ) -); diff --git a/docs/AlphaMail.md b/docs/AlphaMail.md deleted file mode 100644 index 8ffc792..0000000 --- a/docs/AlphaMail.md +++ /dev/null @@ -1,107 +0,0 @@ -AlphaMail -========= - -This transport layer forms the coupling between Zend\Mail and the Email Service Provider [AlphaMail](http://amail.io). - -Installation ------------- - -It is assumed this module is already installed and enabled in your Zend Framework 2 project. If not, please read first the [installation instructions](../README.md) to do so. - -Copy the `./vendor/juriansluiman/slm-mail/config/slm_mail.alpha_mail.local.php.dist` to your `./config/autoload` folder (don't -forget to remove the .dist extension !) and update your username and API key. - -Usage ------ - -> IMPORTANT: AlphaMail REST API is a bit different from other providers. Indeed, it does not support sending emails -directly, by specifying HTML and/or text message. Instead, it requires that you define what they call "project", which -is a message associated with a template. Those projects can either be through their website or programmatically by -using AlphaMail service. AlphaMail templates use a custom templating language which is called "Comlang". If you plan -to create templates programmatically, please refer to the documentation of this templating language. - -### Supported functionalities - -SlmMail defines a new Message class, `SlmMail\Mail\Message\AlphaMail`, that you can use to take advantage of -specific AlphaMail features. Here are a list of supported features. - -#### Project - -AlphaMail has a concept of "project". Each sent message MUST be associated with a project id: - -```php -$message = new \SlmMail\Mail\Message\AlphaMail(); -$message->setProject(2); -``` - -### Use service locator - -If you have access to the service locator, you can retrieve the AlphaMail transport: - -```php -// As stated above, you can also create a specialized AlphaMail message for more features -$message = new \Zend\Mail\Message(); - -// set up Message here - -$transport = $locator->get('SlmMail\Mail\Transport\AlphaMailTransport'); -$transport->send($message); -``` - -Of course, you are encouraged to inject this transport object whenever you need to send an email. - -### Advanced usage - -The transport layer depends on a service class `SlmMail\Service\AlphaMail` which sends the requests to the AlphaMail -server. - -The service class is injected into the `SlmMail\Mail\Transport\HttpTransport` but you can get the service class yourself too: - -```php -$alphaMailService = $locator->get('SlmMail\Service\AlphaMailService'); -$tokens = $alphaMailService->getTokens(); // Example -``` - -The complete list of methods is: - -Messages functions: - -* `send(Message $message)`: used by transport layer, $message instance of `Zend\Mail\Message` ([docs](http://app.amail.io/#/docs/api/)) -* `getEmailStatus($id)`: get status for sent email. You can retrieve the identifier as a return value of `send` method ([docs](http://app.amail.io/#/docs/api/)) - -Projects functions: - -* `createProject($name, $subject, $templateId, $signatureId = 0)`: create a new project ([docs](http://app.amail.io/#/docs/api/)) -* `deleteProject($id)`: delete an existing project ([docs](http://app.amail.io/#/docs/api/)) -* `getProjects()`: get all projects ([docs](http://app.amail.io/#/docs/api/)) -* `getProject($id)`: get a project by its identifier ([docs](http://app.amail.io/#/docs/api/)) - -Templates functions: - -* `createTemplate($name, $text = '', $html = '')`: create a new template ([docs](http://app.amail.io/#/docs/api/)) -* `deleteTemplate($id)`: delete an existing template ([docs](http://app.amail.io/#/docs/api/)) -* `getTemplates()`: get all templates ([docs](http://app.amail.io/#/docs/api/)) -* `getTemplate($id)`: get a template by its identifier ([docs](http://app.amail.io/#/docs/api/)) - -Signatures functions: - -* `createSignature($name, $domain)`: create a new signature ([docs](http://app.amail.io/#/docs/api/)) -* `deleteSignature($id)`: delete an existing signature ([docs](http://app.amail.io/#/docs/api/)) -* `getSignatures()`: get all signatures ([docs](http://app.amail.io/#/docs/api/)) -* `getSignature($id)`: get a signature by its identifier ([docs](http://app.amail.io/#/docs/api/)) - -Token functions: - -* `getTokens()`: retrieve all the tokens (they determine API access to your AlphaMail account) ([docs](http://app.amail.io/#/docs/api/)) - -### Error handling - -If an error occurs when a request is made to the AlphaMail API using `SlmMail\Service\AlphaMailService`, some exceptions -are thrown. Each exception implements the `SlmMail\Exception\ExceptionInterface`, so you can easily filter each SlmMail -exceptions. - -The following exceptions are thrown, depending on the errors returned by AlphaMail: - -* `SlmMail\Service\Exception\InvalidCredentialsException`: this exception is thrown when invalid or no API key was sent. -* `SlmMail\Service\Exception\ValidationErrorException`: this exception is thrown when malformed or missing data is sent. -* `SlmMail\Service\Exception\RuntimeException`: this exception is thrown for other exceptions. diff --git a/docs/Pricing.md b/docs/Pricing.md index 521fc06..1bd00bc 100644 --- a/docs/Pricing.md +++ b/docs/Pricing.md @@ -5,7 +5,6 @@ prices appear to be outdated, please create an issue! Provider | Price | Example with 100 000 emails/month | ------------ | ----- | --------------------------------- -Alpha Mail | up to 6 000 emails/month: free, up to 40 000 emails/month: 9.49 $/month, up to 100 000 emails/month: 79.49$/month, 199.49 $/month, up to 700 000 emails/month: 399.49$/month | 79.49 $ / month Amazon SES | 2 000 messages/day for free, then 0.10$ for 1000 | 4 $ / month Elastic Mail | depends on what you send AND your reputation accross time | between 95$ and 50$ / month Mailgun | five plans depending on a minimum required per month. Free plan: 200 mails / day ; standard plan: 1$ for 1000, minimum of 19$ per month required ; express plan: 0.50$ per 1000, minimum of 59$ per month required ; priority plan: 0.40$ per 1000, minimum of 199$ per month required ; first-class plan: 0.10$ per 1000, minimum of 499$ per month required | 10$ / month with the first-class plan or 40$ / month with the priority plan diff --git a/src/SlmMail/Factory/AlphaMailServiceFactory.php b/src/SlmMail/Factory/AlphaMailServiceFactory.php deleted file mode 100644 index 8dc4486..0000000 --- a/src/SlmMail/Factory/AlphaMailServiceFactory.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMail\Factory; - -use SlmMail\Factory\Exception\RuntimeException; -use SlmMail\Service\AlphaMailService; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; - -class AlphaMailServiceFactory implements FactoryInterface -{ - /** - * {@inheritDoc} - */ - public function createService(ServiceLocatorInterface $serviceLocator) - { - $config = $serviceLocator->get('Config'); - - if (!isset($config['slm_mail']['alpha_mail'])) { - throw new RuntimeException( - 'Config for AlphaMail is not set, did you copy config file into your config/autoload folder ?' - ); - } - - $config = $config['slm_mail']['alpha_mail']; - $service = new AlphaMailService($config['username'], $config['key']); - - $client = $serviceLocator->get('SlmMail\Http\Client'); - $service->setClient($client); - - return $service; - } -} diff --git a/src/SlmMail/Factory/AlphaMailTransportFactory.php b/src/SlmMail/Factory/AlphaMailTransportFactory.php deleted file mode 100644 index 6eec34d..0000000 --- a/src/SlmMail/Factory/AlphaMailTransportFactory.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMail\Factory; - -use SlmMail\Mail\Transport\HttpTransport; -use Zend\ServiceManager\FactoryInterface; -use Zend\ServiceManager\ServiceLocatorInterface; - -class AlphaMailTransportFactory implements FactoryInterface -{ - /** - * {@inheritDoc} - */ - public function createService(ServiceLocatorInterface $serviceLocator) - { - return new HttpTransport($serviceLocator->get('SlmMail\Service\AlphaMailService')); - } -} diff --git a/src/SlmMail/Mail/Message/AlphaMail.php b/src/SlmMail/Mail/Message/AlphaMail.php deleted file mode 100644 index 642e495..0000000 --- a/src/SlmMail/Mail/Message/AlphaMail.php +++ /dev/null @@ -1,104 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMail\Mail\Message; - -use Zend\Mail\Message; - -class AlphaMail extends Message -{ - /** - * Identifier of AlphaMail project id to use - * - * @var int - */ - protected $project; - - /** - * Variables to send to the project (they call it "payload") - * - * @var array - */ - protected $variables = array(); - - /** - * Set the project id to use - * - * @param int $project - * @return self - */ - public function setProject($project) - { - $this->project = (int) $project; - return $this; - } - - /** - * Get the porject id to use - * - * @return string - */ - public function getProject() - { - return $this->project; - } - - /** - * Set variables - * - * @param array $variables - * @return self - */ - public function setVariables(array $variables) - { - $this->variables = $variables; - return $this; - } - - /** - * Get variables - * - * @return array - */ - public function getVariables() - { - return $this->variables; - } -} diff --git a/src/SlmMail/Service/AlphaMailService.php b/src/SlmMail/Service/AlphaMailService.php deleted file mode 100644 index 89ba53b..0000000 --- a/src/SlmMail/Service/AlphaMailService.php +++ /dev/null @@ -1,439 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMail\Service; - -use SlmMail\Mail\Message\AlphaMail as AlphaMailMessage; -use SlmMail\Service\AbstractMailService; -use Zend\Http\Request as HttpRequest; -use Zend\Http\Response as HttpResponse; -use Zend\Mail\Address; -use Zend\Mail\Message; - -class AlphaMailService extends AbstractMailService -{ - /** - * API endpoint - */ - const API_ENDPOINT = 'http://api.amail.io/v1'; - - /** - * AlphaMail API key - * - * @var string - */ - protected $apiKey; - - /** - * @param string $apiKey - */ - public function __construct($apiKey) - { - $this->apiKey = (string) $apiKey; - } - - /** - * ------------------------------------------------------------------------------------------ - * MESSAGES - * ------------------------------------------------------------------------------------------ - */ - - /** - * {@inheritDoc} - * @link http://app.amail.io/#/docs/api/ - * @return string The transaction id of the email - */ - public function send(Message $message) - { - // Contrary to other services, you ABSOLUTELY need a template created on AlphaMail side, - // you cannot directly send a message, therefore we need to enforce that we really have an - // AlphaMailMessage instance - if (!$message instanceof AlphaMailMessage) { - throw new Exception\RuntimeException(sprintf( - 'AlphaMail does not support to send messages directly. It needs a template hosted on ' . - 'AlphaMail servers. Hence, you need to pass an AlphaMailMessage instance ("%s" given)', - get_class($message) - )); - } - - $from = $message->getFrom(); - $to = $message->getTo(); - if (count($from) !== 1 || count($to) !== 1) { - throw new Exception\RuntimeException( - 'AlphaMail API requires exactly one from sender and one to receiver' - ); - } - - $parameters = array( - 'project_id' => $message->getProject(), - 'sender_name' => $from->rewind()->getName() ?: $from->rewind()->getEmail(), - 'sender_email' => $from->rewind()->getEmail(), - 'receiver_name' => $to->rewind()->getName() ?: $to->rewind()->getEmail(), - 'receiver_email' => $to->rewind()->getEmail(), - 'body' => json_encode($message->getVariables()) - ); - - $response = $this->prepareHttpClient('/email/queue') - ->setMethod(HttpRequest::METHOD_POST) - ->setRawBody(json_encode($this->filterParameters($parameters))) - ->send(); - - return $this->parseResponse($response); - } - - /** - * Get status about a sent message - * - * @link http://app.amail.io/#/docs/api/ - * @param int $messageId - * @return array - */ - public function getEmailStatus($messageId) - { - $response = $this->prepareHttpClient('/email/queue/' . $messageId . '/status') - ->send(); - - return $this->parseResponse($response); - } - - /** - * ------------------------------------------------------------------------------------------ - * PROJECTS - * ------------------------------------------------------------------------------------------ - */ - - /** - * Create a new project - * - * @link http://app.amail.io/#/docs/api/ - * @param string $name - * @param string $subject - * @param int $templateId - * @param int $signatureId - * @return array - */ - public function createProject($name, $subject, $templateId, $signatureId = 0) - { - $parameters = array( - 'name' => $name, - 'subject' => $subject, - 'template_id' => (int) $templateId, - 'signature_id' => (int) $signatureId - ); - - $response = $this->prepareHttpClient('/projects') - ->setMethod(HttpRequest::METHOD_POST) - ->setRawBody(json_encode($this->filterParameters($parameters))) - ->send(); - - return $this->parseResponse($response); - } - - /** - * Delete a single project - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return void - */ - public function deleteProjects($id) - { - $response = $this->prepareHttpClient('/projects/' . (int)$id) - ->setMethod(HttpRequest::METHOD_DELETE) - ->send(); - - $this->parseResponse($response); - } - - /** - * Retrieve all projects - * - * @link http://app.amail.io/#/docs/api/ - * @return array - */ - public function getProjects() - { - $response = $this->prepareHttpClient('/projects') - ->send(); - - return $this->parseResponse($response); - } - - /** - * Retrieve details for a single project - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return array - */ - public function getProject($id) - { - $response = $this->prepareHttpClient('/projects/' . (int)$id) - ->send(); - - return $this->parseResponse($response); - } - - /** - * ------------------------------------------------------------------------------------------ - * TEMPLATES - * ------------------------------------------------------------------------------------------ - */ - - /** - * Create a new template to use with projects - * - * @link http://app.amail.io/#/docs/api/ - * @param string $name - * @param string $text - * @param string $html - * @return array - */ - public function createTemplate($name, $text = '', $html = '') - { - $parameters = array( - 'name' => $name, - 'content' => array( - 'text' => $text, - 'html' => $html - ) - ); - - $response = $this->prepareHttpClient('/templates') - ->setMethod(HttpRequest::METHOD_POST) - ->setRawBody(json_encode($this->filterParameters($parameters))) - ->send(); - - return $this->parseResponse($response); - } - - /** - * Delete a single template - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return void - */ - public function deleteTemplate($id) - { - $response = $this->prepareHttpClient('/templates/' . (int)$id) - ->setMethod(HttpRequest::METHOD_DELETE) - ->send(); - - $this->parseResponse($response); - } - - /** - * Retrieve all the templates - * - * @link http://app.amail.io/#/docs/api/ - * @return array - */ - public function getTemplates() - { - $response = $this->prepareHttpClient('/templates') - ->send(); - - return $this->parseResponse($response); - } - - /** - * Retrieve details for a single template - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return array - */ - public function getTemplate($id) - { - $response = $this->prepareHttpClient('/templates/' . (int)$id) - ->send(); - - return $this->parseResponse($response); - } - - /** - * ------------------------------------------------------------------------------------------ - * SIGNATURES - * ------------------------------------------------------------------------------------------ - */ - - /** - * Create a new signature to use with your mails - * - * @link http://app.amail.io/#/docs/api/ - * @param string $name - * @param string $domain - * @return array - */ - public function createSignature($name, $domain) - { - $parameters = array( - 'name' => $name, - 'dns_record' => array( - 'domain' => $domain - ) - ); - - $response = $this->prepareHttpClient('/signatures') - ->setMethod(HttpRequest::METHOD_POST) - ->setRawBody(json_encode($this->filterParameters($parameters))) - ->send(); - - return $this->parseResponse($response); - } - - /** - * Delete a single signature - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return void - */ - public function deleteSignature($id) - { - $response = $this->prepareHttpClient('/signatures/' . (int)$id) - ->setMethod(HttpRequest::METHOD_DELETE) - ->send(); - - $this->parseResponse($response); - } - - /** - * Retrieve all the signatures - * - * @link http://app.amail.io/#/docs/api/ - * @return array - */ - public function getSignatures() - { - $response = $this->prepareHttpClient('/signatures') - ->send(); - - return $this->parseResponse($response); - } - - /** - * Retrieve details for a single signature - * - * @link http://app.amail.io/#/docs/api/ - * @param int $id - * @return array - */ - public function getSignature($id) - { - $response = $this->prepareHttpClient('/signatures/' . (int)$id) - ->send(); - - return $this->parseResponse($response); - } - - /** - * ------------------------------------------------------------------------------------------ - * TOKENS - * ------------------------------------------------------------------------------------------ - */ - - /** - * Retrieve all the tokens (they determine API access to your AlphaMail account) - * - * @link http://app.amail.io/#/docs/api - * @return array - */ - public function getTokens() - { - $response = $this->prepareHttpClient('/tokens') - ->send(); - - return $this->parseResponse($response); - } - - /** - * @param string $uri - * @param array $parameters - * @return \Zend\Http\Client - */ - private function prepareHttpClient($uri, array $parameters = array()) - { - $client = $this->getClient()->resetParameters(); - $client->getRequest() - ->getHeaders() - ->addHeaderLine('Authorization', 'Basic ' . base64_encode(':' . $this->apiKey)); - - $client->setMethod(HttpRequest::METHOD_GET) - ->setUri(self::API_ENDPOINT . $uri) - ->setParameterGet($this->filterParameters($parameters)); - - return $client; - } - - /** - * @param HttpResponse $response - * @throws Exception\InvalidCredentialsException - * @throws Exception\ValidationErrorException - * @throws Exception\RuntimeException - * @return array - */ - private function parseResponse(HttpResponse $response) - { - $result = json_decode($response->getBody(), true); - - if ($response->isSuccess()) { - return isset($result['result']) ? $result['result'] : array(); - } - - switch ($response->getStatusCode()) { - case 401: - case 403: - throw new Exception\InvalidCredentialsException(sprintf( - 'Authentication error: missing or incorrect AlphaMail API key: %s', $result['message'] - )); - case 400: - case 405: - throw new Exception\ValidationErrorException(sprintf( - 'Validation error on AlphaMail (code %s): %s', $result['error_code'], $result['message'] - )); - default: - throw new Exception\RuntimeException(sprintf( - 'Unknown error on AlphaMail (code %s): %s', $result['error_code'], $result['message'] - )); - } - } -} diff --git a/tests/SlmMailTest/Mail/Transport/AlphaMailTransportTest.php b/tests/SlmMailTest/Mail/Transport/AlphaMailTransportTest.php deleted file mode 100644 index 5ced46c..0000000 --- a/tests/SlmMailTest/Mail/Transport/AlphaMailTransportTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMail\Mail\Transport; - -use PHPUnit_Framework_TestCase; -use SlmMailTest\Util\ServiceManagerFactory; -use Zend\Mail\Message; - -class AlphaMailTransportTest extends PHPUnit_Framework_TestCase -{ - public function testCreateFromFactory() - { - $transport = ServiceManagerFactory::getServiceManager()->get('SlmMail\Mail\Transport\AlphaMailTransport'); - - $this->assertInstanceOf('SlmMail\Mail\Transport\HttpTransport', $transport); - - $property = new \ReflectionProperty('SlmMail\Mail\Transport\HttpTransport', 'service'); - $property->setAccessible(true); - - $this->assertInstanceOf('SlmMail\Service\AlphaMailService', $property->getValue($transport)); - } - - public function testTransportUsesAlphaMailService() - { - $service = $this->getMock('SlmMail\Service\AlphaMailService', array(), array('my-username', 'my-secret-key')); - $transport = new HttpTransport($service); - $message = new Message(); - - $service->expects($this->once()) - ->method('send') - ->with($this->equalTo($message)); - - $transport->send($message); - } -} diff --git a/tests/SlmMailTest/Service/AlphaMailServiceTest.php b/tests/SlmMailTest/Service/AlphaMailServiceTest.php deleted file mode 100644 index ecdadd3..0000000 --- a/tests/SlmMailTest/Service/AlphaMailServiceTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright 2012-2013 Jurian Sluiman. - * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @link http://juriansluiman.nl - */ - -namespace SlmMailTest\Service; - -use PHPUnit_Framework_TestCase; -use SlmMail\Service\AlphaMailService; -use SlmMailTest\Util\ServiceManagerFactory; -use Zend\Http\Response as HttpResponse; - -class AlphaMailServiceTest extends PHPUnit_Framework_TestCase -{ - /** - * @var AlphaMailService - */ - protected $service; - - public function setUp() - { - $this->service = new AlphaMailService('my-username', 'my-secret-key'); - } - - public function testCreateFromFactory() - { - $service = ServiceManagerFactory::getServiceManager()->get('SlmMail\Service\AlphaMailService'); - $this->assertInstanceOf('SlmMail\Service\AlphaMailService', $service); - } -} diff --git a/tests/testing.config.php b/tests/testing.config.php index bca888b..2bd21fc 100644 --- a/tests/testing.config.php +++ b/tests/testing.config.php @@ -2,11 +2,6 @@ return array( 'slm_mail' => array( - 'alpha_mail' => array( - 'username' => 'my-username', - 'key' => 'my-secret-key' - ), - 'elastic_email' => array( 'username' => 'my-username', 'key' => 'my-secret-key'