Commit Graph

157 Commits

Author SHA1 Message Date
Tobias Nyholm
eb07576e6a
Ported MessageBuilder and BatchMessage (#472)
* Ported MessageBuilder and BatchMessage

* Added test for MessageBuilder

* Added test for BatchMessageTest

* cs

* cs

* Removed PHP7 code
2018-08-04 21:30:15 +02:00
Radoje Albijanic
83c5f76f87 Cast campaign ID-s to string (#460)
* 413 error proper handle.

* Cast campaign id-s to string. Added tests for that.

* Style fixes
2018-04-09 18:51:09 +02:00
Quentin
869eff42e1 style: Fix coding style. 2018-02-01 22:42:12 +00:00
Quentin
84734cf758 refactor: Remove dead code. 2018-02-01 22:42:12 +00:00
Quentin
ef5336450e chore(unsubscribe): Add copyright. 2018-02-01 22:42:12 +00:00
Quentin
ce2bd4b0f1 feat(unsubscribe): Handle tags in Unsubscribe v3 api. 2018-02-01 22:42:12 +00:00
François-Xavier de Guillebon
b73adaf60c Fixed stats retrieval (#384)
* [Stats] Fixed stats always empty

* Added tests
2017-12-01 21:10:21 +01:00
Hannes Magnússon
ce484ecbc8 Grammar typo (#413)
* Grammar typo

* Fixed style errors as reported by styleci
2017-11-22 09:37:04 +01:00
maximzasorin
e800038f21 Add domain verification (#370) 2017-06-22 19:35:42 +02:00
Temirkhan
6d56fa6a0d Few test corrections to preview where it goes. (#358)
* Few test corrections to preview where it goes.

* Removed TODO. Fixed dependency
2017-05-22 13:47:11 +02:00
Tobias Nyholm
487c1edd77 Prepare for release 2.3.2 (#352)
* Style fixes

* Added changelog
2017-05-16 15:20:33 +02:00
Alexandre Dupuy
d504472206 fix: named addresses must be surrounded by double quotes (#349)
* fix: named addresses must be surrounded by double quotes

Due to your recent API update, named addresses with special chars (like parentheses) are now rejected if they are surrounded by simple quotes
They must be surrounded by double quotes

'Whoever (SomeCompany)' <some@address.com> is no longer valid and will be rejected by your API
"Whoever (SomeCompany)" <some@address.com> is valid and will be OK

* sprintf instaead of old school concatenation
2017-05-16 14:51:02 +02:00
Tobias Nyholm
e30955fa51 Do not skip route test (#342) 2017-04-14 10:59:35 +02:00
Tobias Nyholm
d4ab1b0a87 Support mime messages (#341)
* Support mime messages

* cs

* Removed pointless integration tests

* typo

* Create new endpoint for message.mime

* cs

* Added docs

* Doc fixes

* Refactor
2017-04-14 10:31:13 +02:00
Tobias Nyholm
fab86bbef3 Make integrationt tests safe to run simultaneously (#338)
* Make integrationt tests safe to run simultaneously

* cs

* We only have the credentials when we do not make a PR
2017-04-08 11:22:20 +02:00
z38
edcfcc397f Add integration tests for Route API (#334) 2017-04-08 10:34:57 +02:00
z38
b713364dc0 Fix integration tests for domain API (#294)
* Send multipart/form-data requests by default

* Fix integration tests for Domain API
2017-04-07 18:24:48 -05:00
z38
0bc0a3b1a5 Fix disordered POST parameters (#279) 2017-04-07 18:24:37 -05:00
Tobias Nyholm
84fb433061 Renamed Routes to Route (#308)
* Renamed Routes to Route

Class names should be in singlular

* Update namespaces
2017-03-26 16:11:33 +02:00
Tobias Nyholm
0eb15969b9 Made most classes final (#310)
* Made most classes final

* bugfix
2017-03-26 10:49:33 +02:00
James Kraus
d2638a0457 Bug fix - Allow adding custom headers with non-array value (#255)
* Bug fix - Allow adding custom headers with non-array value

* Remove whitespace

* Functional test for adding custom headers (either singular or multiple)

* Style fixes for functional test
2017-03-26 10:23:03 +02:00
Tobias Nyholm
0f4fe2bf9c Improving safe hydrate (#307)
* Improving safe deseriliaze

* Fixes

* Use switch statement

* cs

* bugfix

* Update method name

* Update return docs
2017-03-26 10:16:36 +02:00
Tobias Nyholm
e74d7ad130 Added test for Route::Create (#306)
* Added test for Route::Create

* cd
2017-03-25 14:02:11 +01:00
Tobias Nyholm
1bfd40721e Added factory methods (#304)
* Added factory methods

* Removed urelated code

* Update test code
2017-03-25 13:48:03 +01:00
Tobias Nyholm
84a5c5dd4a Rename deserializer to hydrator (#296)
* Renamed "deserializer" to "hydrator"

* Make sure we use singlular in namespaces

Also did some cleanups.

* Fixed typo

* cs

* minor fix
2017-03-22 07:44:08 +01:00
z38
b3f24e9d7a Fix setting Reply-To multiple times (#300) 2017-03-14 16:51:33 +01:00
Sergei Beregov
718547a273 #276 additional method to get an attachment (#277)
* #276 additional method to get an attachment

* #276 fix code style

* Add Mailgun::getAttachment + test

* code style fix
2017-02-28 08:10:04 +01:00
Michal Hanajík
74929b6518 Renamed namespace from Resource\Api to Model (#293)
* Renamed namespace from Resource\Api to Model

* Moved Resources\ApiResponse to Models namespace

Signed-off-by: Michal Hanajík <michal.hanajik@outlook.com>

* Fix of code style
2017-02-23 20:56:30 +01:00
Tobias Nyholm
d5a49f2e6d Tag api (#286)
* Started on tag api

* Added TagAPI

* code style

* cs

* removed final

* Adjusting to Davids feedback.

* Added PagingProvider interface
2017-02-21 08:22:57 +01:00
Sean Johnson
e177e13a0c Update boundary regex to match RFC1341 (#283)
* Update boundary regex to match RFC1341
2017-02-18 10:53:21 -06:00
David Garcia
1613843c7e Routes API (#249)
* Add initial (empty) Routes PHP Unit Test file

We still need to provide the automated tests

* Add initial Routes file

* Describe API Methods

* Inherit method from TestCase - adding @inheritdoc annotation

* Add new DTOs to map API responses to known objects

* Add new Response to manage the Routes list

* Implement method to retrieve a list of Routes

* Add new Response to manage a single Route resource

* Implement method to retrieve a single Route

* Set ShowResponse as final

* Add new Response to manage the Create process

* Implement method to create a new Route

* Fix missing annotation

* Add new Response to manage the Delete Route process

* Implement method to delete a Route based on the ID

* Add new Response to manage the Update Route process

This response is based on Domain API docs due there are no examples on
Routes API docs. We may need to update the response.

* Implement method to update a Route based on the ID

* Require a $limit value greater than 0

* Require a $skip value greater than or equal to 0

* Set UpdateResponse as final

* Add new (empty) public methods to test the Routes API

* Provide method to get the Routes API from Mailgun Client

* Add missed annotation

* Update ShowResponse to return an instance of ApiResponse instead of the DTO

* Update annotation

* Fix annotation

* Update array $actions to provide an empty array by default

* Update parameters to make sure the last arg always is a DateTime (or null)

* Use empty()

* Remove DTO suffix

* Move DTOs to the parent folder/namespace

* Fix annotations
2016-12-09 14:15:06 -08:00
Sean Johnson
ce8215ff6c Apply fixes from StyleCI (#243) 2016-12-06 12:12:52 -06:00
Tobias Nyholm
61a019ad67 Fixed integration tests (#233)
* Fixed integration tests

* Update integration tests

* cs
2016-11-24 09:59:05 +01:00
Sean Johnson
ce9739ea91 Applied fixes from StyleCI (#228) 2016-11-23 23:02:12 +01:00
Tobias Nyholm
8668b4c222 Updated to use Assert 1.2 (#224) 2016-11-23 23:01:26 +01:00
Tobias Nyholm
9bd6732efd Introduce a request builder. (#217)
* Introduce a request builder.

We inject every dependency (eg RequestFactory and MultipartStreamBuilder) and we do not have to use postMultipart.

* code style

* Use uppercase on http verbs

* Added setters and use getters

* Added tests

* style
2016-11-23 21:55:05 +01:00
Sean Johnson
0da5f410a9 Rename serializer to deserializer (#201) (#216) 2016-11-12 02:50:47 +01:00
Tobias Nyholm
1a71c14097 Removed inheritence, Renamed classes, Mark all classes as final (#212)
* Removed inheritence, Renamed classes, Mark all classes as final

* code style

* Updated docs

* Code style

* Be consistant with the naming of functions

* Fixed tests
2016-11-11 14:53:26 -06:00
Sean Johnson
58430e4537 Domains API, #187 (#198) 2016-10-27 08:34:27 +02:00
Tobias Nyholm
738e6e32e2 POC - Better api (#192)
* Added base for the new API

* code style

* Added response classes

* Added support for serializer

* The abstract API should not know of Mailgun

* Minor

* minor

* Using a client configrator

* code style

* Put HTTPClient in the configurator

* Do not use the api() function

* Use stable version of Assert

* style

* Fixed tests

* make the httpClient private

* Renamed ResponseSerializer to ResponseDeserializer

* Disabled tests that are testing error messages with Assert

* style fixes

* Refactoring fix
2016-10-24 12:01:32 -05:00
Tobias Nyholm
043658f996 Added meta files (#195)
* Added meta files

* Style fixes from StyleCI
2016-10-14 19:20:46 -05:00
David Garcia
3aeb602406 Make sure $variables is an array in addRecipient() (#176)
* Write test to verify expected behaviour when we provide a String

* Fix broken test checking if the variable is an Array

* PSR Standard using single quote instead of double quote
2016-09-30 15:03:35 +02:00
David Garcia
6513c12d8c Applied fixes from StyleCI (#177) 2016-09-27 15:23:08 +02:00
Tobias Nyholm
8fe342f5b9 Apply fixes from StyleCI and make sure we add MIT license properly (#163)
* Applied fixes from StyleCI

* Create LICENSE
2016-09-18 09:56:14 +02:00
Wim Verstuyf
5d04bc63a7 Add attachment from memory (#158) 2016-09-06 13:05:50 +02:00
Tobias Nyholm
bf8d962739 Added more test cases 2016-08-10 18:28:19 +02:00
Tobias Nyholm
7119f18c26 Do not test same thing twice 2016-08-10 17:32:10 +02:00
Tobias Nyholm
741aa0d120 Make sure we use proper POST data arrays 2016-08-10 17:26:24 +02:00
Tobias Nyholm
9f98baa8ca Added more generic tests 2016-08-10 17:13:24 +02:00
Tobias Nyholm
cd001cf5b3 Added tests and use PSR4 2016-08-10 17:06:27 +02:00
Travis Swientek
0a7c96c34a Fixed inline image issue. Added new tests. 2016-08-10 16:37:08 +02:00
Tobias Nyholm
2515832216 Added functional tests 2016-08-05 10:40:49 +02:00
David Garcia
844cdb6a58 PHP Code Sniffer 2016-07-26 13:43:36 +01:00
David Garcia
817dad1f90 Applied fixes from StyleCI 2016-07-24 07:42:47 -04:00
Sergey Obukhov
b8a0abc075 Merge pull request #138 from Nyholm/issue-122
Build a string query form array
2016-07-20 14:56:59 -07:00
Sergey Obukhov
341e06a196 Merge pull request #90 from z38/fix-webhook-notices
Fix notices on empty webhook requests
2016-07-20 12:34:11 -07:00
Tobias Nyholm
aaf61b4466 test fix 2016-07-19 15:06:49 +02:00
Tobias Nyholm
b85f1461d4 Removed unused tests and some parameters from the constructor 2016-03-05 11:13:28 +01:00
Tobias Nyholm
b080b181ac Make sure we do not depend on any http transport library 2015-10-03 22:10:48 +02:00
z38
1f555c2f27 Fixed notices on empty webhook requests 2015-09-13 20:01:16 +02:00
Tobias Nyholm
3bb69d8cbe * Updated composer.json to guzzle v5
* Don't allow HHVM to fail
* Updated RestClient to Guzzle5
* Removed php5.3 from travis.
* Bugfix and removed debug code
2015-05-05 18:19:10 -07:00
Wietse de Vries
edae22eba4 Updated default API version from v2 to v3
http://blog.mailgun.com/default-api-version-now-v3/
2015-05-05 18:18:08 -07:00
Travis Swientek
b34805d86b Fixed broken test. 2014-11-19 14:52:34 -08:00
Travis Swientek
b28a742efb Merge branch 'verifyWebhookSignature' of https://github.com/gmacon/mailgun-php into gmacon-verifyWebhookSignature
Conflicts:
	src/Mailgun/Mailgun.php
2014-11-19 14:29:08 -08:00
Travis Swientek
f781158019 Removed legacy PHP closing braces 2014-10-06 15:53:33 -07:00
George Macon
46f63044ad Add Mailgun->verifyWebhookSignature 2014-06-24 17:36:21 -04:00
Iain Cambridge
e75c245cd6 Fix 5.3 compat 2014-05-14 14:08:12 +01:00
Iain Cambridge
e9e0f39ca8 Apply coding style that is in src 2014-05-14 14:06:05 +01:00
Iain Cambridge
6196f8df49 Add setMessage 2014-05-14 14:03:12 +01:00
Iain Cambridge
d28c6b81c9 Comment out possible php bug failure 2014-05-13 17:05:32 +01:00
Iain Cambridge
c203558234 Fix php 5.3 compat 2014-05-13 16:32:14 +01:00
Iain Cambridge
bdeadc1a01 Add tests to ensure exceptions are flung and fixed wrong variable name used 2014-05-13 16:12:32 +01:00
Iain Cambridge
502fac0b37 Fix fatal error in not finding exception.
Tried to throw MissingRequiredMIMEParameters which didn't exist in current namespace or added via use. Connection exceptions was included by MissingRequiredMIMEParameters is in messages exceptions so changed the added exception name to messages.

Exception message constant didn't exist. So added it.
2014-05-13 14:54:10 +01:00
Iain Cambridge
3af838f2c8 Move mocks
Created a Mocks directory to seperate mocks from classes.

I moved Mailgun\Tests\MailGunTest to Mailgun\Test\Mocks\Mailgun. As it's not a
test it's a mock. So shouldn't be suffixed with Test.

I mocked Mailgun\Tests\Connection\TestBroker to Mailgun\Tests\Mocks\Connection\TestBroker as it's a mock and should be with other mocks.
2014-05-13 14:25:26 +01:00
Travis Swientek
717cf5faed Improved security of OptInHandler. 2014-01-24 22:07:53 +00:00
Travis Swientek
af53fd50ff Ability to rename attachments and inline images. 2014-01-13 22:53:34 +00:00
Travis Swientek
5d7daeeeca Added method to return all message ids after a BatchMessage operation. 2013-10-11 17:31:04 -07:00
Travis Swientek
af853234e4 Refactored counters, batch job trigger adjustment, all recipient types in variables. 2013-10-11 13:36:35 -07:00
Travis Swientek
fc9685182b Fixed missing IDs for batch message recipients. Closes #15. 2013-10-07 13:53:23 -07:00
Travis Swientek
116fb33255 Relaxed Guzzle requirement, fixed reply-to bug, updated point release version. Fixes #7 Fixes #9 2013-09-12 14:19:23 -07:00
yoye
947267e935 Merge branch 'master' of github.com:yoye/mailgun-php 2013-09-05 15:19:07 +02:00
yoye
789eb27228 Fix bug toRecipientCount increment in BatchMessage 2013-09-05 10:35:26 +02:00
Travis Swientek
9438694415 Fixes #4. DEFAULT_TIME_ZONE is not defined. 2013-09-04 09:50:50 -07:00
Travis Swientek
24e6a01651 Added message id return to batch sending. 2013-08-21 23:11:24 -07:00
Travis Swientek
f4b7ff61e7 Fixed broken test 2013-08-19 15:02:07 -07:00
Travis Swientek
07837600e6 Added new OptInHandler and tests. 2013-08-16 11:20:01 -07:00
Travis Swientek
62d01db1e4 Removed inclusion of constants 2013-08-13 13:49:00 -07:00
Travis Swientek
685a7351d5 Refactor. Covered refactor in tests. 2013-08-13 12:26:34 -07:00
Travis Swientek
8498145b2f Adjustments 2013-08-08 16:28:02 -07:00
Travis Swientek
104bb72008 Refactor complete 2013-08-08 10:39:44 -07:00
Travis Swientek
1ff4357810 Modified and renamed HTTPBroker to RestClient. 2013-08-07 16:22:19 -07:00
Travis Swientek
1a390827b0 Update Bootstrap.php 2013-08-02 15:19:44 -07:00
Travis Swientek
7f1c066a3b Bootstrap tweakage 2013-08-02 14:49:56 -07:00
Travis Swientek
017f4fcd92 Finished Lists endpoint and added Address Validator 2013-08-02 11:30:09 -07:00
Travis Swientek
7872398f21 Merge branch 'master' of https://github.com/travelton/Mailgun-PHP 2013-08-02 10:49:04 -07:00
Travis Swientek
0bd40490dd Addition of campaigns, logs, lists, and routes 2013-08-02 10:48:57 -07:00
Travis Swientek
4ca9d8b08d Adjusted readme and exceptions 2013-07-28 15:56:48 -07:00
Travis Swientek
2f06edcee4 Another attempt to fix TestBroker 2013-07-25 16:15:20 -07:00
Travis Swientek
8196384b4c Fixed standard class declaration in TestBroker 2013-07-25 16:09:20 -07:00
Travis Swientek
71c4ce388e Updated .travis.yml to include composer dependencies. 2013-07-25 15:58:01 -07:00