Version Description
- 2017-12-24
- New: Mailgun API integration
- New: New filter controls
- New: WPML conflict fix
- Fix: Minor old bugs
Download this release
Release Info
Developer | yehudah |
Plugin | ![]() |
Version | 1.8 |
Comparing to | |
See all releases |
Code changes from version 1.7.10 to 1.8
- Postman/Postman-Configuration/PostmanConfigurationController.php +7 -1
- Postman/Postman-Controller/PostmanWelcomeController.php +219 -0
- Postman/Postman-Email-Log/PostmanEmailLogController.php +17 -5
- Postman/Postman-Email-Log/PostmanEmailLogService.php +6 -4
- Postman/Postman-Email-Log/PostmanEmailLogView.php +15 -3
- Postman/Postman-Mail/PostmanMailgunMailEngine.php +260 -0
- Postman/Postman-Mail/PostmanMailgunTransport.php +248 -0
- Postman/Postman-Mail/PostmanMessage.php +2 -2
- Postman/Postman-Mail/PostmanTransportRegistry.php +97 -94
- Postman/Postman-Mail/mailgun/composer.json +7 -0
- Postman/Postman-Mail/mailgun/composer.lock +801 -0
- Postman/Postman-Mail/mailgun/mailgun.php +2 -0
- Postman/Postman-Mail/mailgun/vendor/autoload.php +7 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.gitignore +2 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.travis.yml +26 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/CHANGELOG.md +54 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/LICENSE +21 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/README.md +297 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/composer.json +23 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/examples/base64_decode.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/examples/base64_encode.php +21 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/examples/uppercase.php +9 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/phpunit.xml.dist +19 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/src/CallbackFilter.php +120 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/src/functions.php +146 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/tests/FilterTest.php +386 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/tests/FunTest.php +44 -0
- Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/tests/FunZlibTest.php +79 -0
- Postman/Postman-Mail/mailgun/vendor/composer/ClassLoader.php +413 -0
- Postman/Postman-Mail/mailgun/vendor/composer/LICENSE +433 -0
- Postman/Postman-Mail/mailgun/vendor/composer/autoload_classmap.php +9 -0
- Postman/Postman-Mail/mailgun/vendor/composer/autoload_files.php +12 -0
- Postman/Postman-Mail/mailgun/vendor/composer/autoload_namespaces.php +10 -0
- Postman/Postman-Mail/mailgun/vendor/composer/autoload_psr4.php +21 -0
- Postman/Postman-Mail/mailgun/vendor/composer/autoload_real.php +59 -0
- Postman/Postman-Mail/mailgun/vendor/composer/installed.json +812 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/CHANGELOG.md +110 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/README.md +739 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/composer.json +39 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/AppendStream.php +233 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/BufferStream.php +137 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/CachingStream.php +138 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/DroppingStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/FnStream.php +149 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/InflateStream.php +52 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +39 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/LimitStream.php +155 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/MessageTrait.php +183 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/MultipartStream.php +153 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/NoSeekStream.php +22 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/PumpStream.php +165 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/Request.php +142 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/Response.php +132 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/ServerRequest.php +358 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/Stream.php +257 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +149 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/StreamWrapper.php +121 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/UploadedFile.php +316 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/Uri.php +702 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/UriNormalizer.php +216 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/UriResolver.php +219 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/functions.php +828 -0
- Postman/Postman-Mail/mailgun/vendor/guzzlehttp/psr7/src/functions_include.php +6 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/CHANGELOG.md +174 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/LICENSE +17 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/README.md +197 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/composer.json +41 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/doc/attachments.md +47 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/doc/index.md +330 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/doc/pagination.md +17 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Domain.php +266 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Event.php +38 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/HttpApi.php +235 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Message.php +170 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Pagination.php +83 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Route.php +157 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Stats.php +52 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Suppression.php +76 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Suppression/Bounce.php +113 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Suppression/Complaint.php +116 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Suppression/Unsubscribe.php +113 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Tag.php +128 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Api/Webhook.php +160 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Assert.php +25 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/Exceptions/GenericHTTPError.php +39 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/Exceptions/InvalidCredentials.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/Exceptions/MissingEndpoint.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/Exceptions/MissingRequiredParameters.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/Exceptions/NoDomainsConfigured.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php +379 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Constants/Api.php +24 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Constants/ExceptionMessages.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception/HttpClientException.php +85 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception/HttpServerException.php +33 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception/HydrationException.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception/InvalidArgumentException.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Exception/UnknownErrorException.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/HttpClient/Plugin/History.php +45 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/HttpClient/Plugin/ReplaceUriPlugin.php +45 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/HttpClientConfigurator.php +185 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Hydrator/ArrayHydrator.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Hydrator/Hydrator.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Hydrator/ModelHydrator.php +50 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Hydrator/NoopHydrator.php +31 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Lists/OptInHandler.php +60 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Lists/README.md +116 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Mailgun.php +381 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/BatchMessage.php +154 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/Exceptions/InvalidParameter.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/Exceptions/InvalidParameterType.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/Exceptions/MissingRequiredMIMEParameters.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/Exceptions/TooManyParameters.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/MessageBuilder.php +529 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Messages/README.md +138 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/ApiResponse.php +25 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/ConnectionResponse.php +72 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/CreateCredentialResponse.php +49 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/CreateResponse.php +119 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/CredentialResponse.php +77 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/CredentialResponseItem.php +97 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/DeleteCredentialResponse.php +83 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/DeleteResponse.php +67 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/DnsRecord.php +123 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/Domain.php +147 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/IndexResponse.php +78 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/ShowResponse.php +99 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/UpdateConnectionResponse.php +83 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/UpdateCredentialResponse.php +49 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Event/Event.php +505 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Event/EventResponse.php +57 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Message/SendResponse.php +74 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Message/ShowResponse.php +402 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/PaginationResponse.php +69 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/PagingProvider.php +44 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Action.php +57 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Response/CreateResponse.php +68 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Response/DeleteResponse.php +67 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Response/IndexResponse.php +77 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Response/ShowResponse.php +54 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Response/UpdateResponse.php +68 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Route/Route.php +133 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Stats/AllResponse.php +77 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Stats/AllResponseItem.php +113 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Stats/TotalResponse.php +105 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Stats/TotalResponseItem.php +97 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/BaseResponse.php +69 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Bounce/Bounce.php +123 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Bounce/CreateResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Bounce/DeleteResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Bounce/IndexResponse.php +62 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Bounce/ShowResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Complaint/Complaint.php +75 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Complaint/CreateResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Complaint/DeleteResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Complaint/IndexResponse.php +62 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Complaint/ShowResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Unsubscribe/CreateResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Unsubscribe/DeleteResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Unsubscribe/IndexResponse.php +62 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Unsubscribe/ShowResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Suppression/Unsubscribe/Unsubscribe.php +99 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/DeleteResponse.php +49 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/IndexResponse.php +60 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/ShowResponse.php +19 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/StatisticsResponse.php +131 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/Tag.php +73 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Tag/UpdateResponse.php +49 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/BaseResponse.php +78 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/CreateResponse.php +17 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/DeleteResponse.php +17 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/IndexResponse.php +219 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/ShowResponse.php +56 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/Model/Webhook/UpdateResponse.php +17 -0
- Postman/Postman-Mail/mailgun/vendor/mailgun/mailgun-php/src/Mailgun/RequestBuilder.php +121 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/CHANGELOG.md +137 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/README.md +55 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/composer.json +43 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/BatchClient.php +73 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/BatchResult.php +181 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php +27 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/EmulatedHttpClient.php +27 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/BatchException.php +39 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/ClientErrorException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/LoopException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Exception/ServerErrorException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/FlexibleHttpClient.php +39 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientDecorator.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientEmulator.php +32 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientPool.php +59 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php +45 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php +31 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php +41 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientPoolItem.php +178 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpClientRouter.php +74 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/HttpMethodsClient.php +205 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin.php +32 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php +77 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php +48 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php +38 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php +54 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php +123 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/CookiePlugin.php +180 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php +140 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php +55 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php +45 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php +43 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php +41 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php +41 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php +49 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/Journal.php +31 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php +54 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php +270 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php +47 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/Plugin/RetryPlugin.php +122 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/PluginClient.php +179 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/client-common/src/PluginClientFactory.php +62 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/.php_cs +9 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/.styleci.yml +4 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/CHANGELOG.md +163 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/README.md +44 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/composer.json +50 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/puli.json +242 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/src/Client.php +371 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/src/CurlPromise.php +108 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/src/MultiRunner.php +127 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/src/PromiseCore.php +224 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/curl-client/src/ResponseBuilder.php +21 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/CHANGELOG.md +186 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/README.md +46 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/composer.json +48 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/ClassDiscovery.php +207 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception.php +12 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php +51 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception/NotFoundException.php +16 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php +12 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php +15 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/HttpClientDiscovery.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/MessageFactoryDiscovery.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/NotFoundException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php +82 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php +23 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php +24 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php +91 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/StreamFactoryDiscovery.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/discovery/src/UriFactoryDiscovery.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/CHANGELOG.md +72 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/LICENSE +20 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/README.md +57 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/composer.json +40 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/puli.json +12 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Exception.php +12 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Exception/HttpException.php +74 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Exception/NetworkException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Exception/RequestException.php +43 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Exception/TransferException.php +14 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/HttpAsyncClient.php +27 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/HttpClient.php +28 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php +57 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php +56 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/CHANGELOG.md +65 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/README.md +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/composer.json +27 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/puli.json +43 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/src/MessageFactory.php +12 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/src/RequestFactory.php +34 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/src/ResponseFactory.php +35 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/src/StreamFactory.php +25 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message-factory/src/UriFactory.php +24 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/CHANGELOG.md +139 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/README.md +61 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/apigen.neon +6 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/composer.json +60 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/puli.json +111 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication.php +22 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/AutoBasicAuth.php +48 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/BasicAuth.php +44 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/Bearer.php +37 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/Chain.php +47 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/Matching.php +74 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/QueryParam.php +50 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/RequestConditional.php +47 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Authentication/Wsse.php +58 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Builder/ResponseBuilder.php +148 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Cookie.php +526 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/CookieJar.php +220 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/CookieUtil.php +53 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/MessageDecorator.php +133 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/RequestDecorator.php +88 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/ResponseDecorator.php +57 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Decorator/StreamDecorator.php +138 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/ChunkStream.php +39 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/CompressStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/DechunkStream.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/DecompressStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/DeflateStream.php +38 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/Filter/Chunk.php +30 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/FilteredStream.php +198 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/GzipDecodeStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/GzipEncodeStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Encoding/InflateStream.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Exception.php +10 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Exception/UnexpectedValueException.php +9 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Formatter.php +32 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php +80 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php +91 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Formatter/SimpleFormatter.php +42 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php +61 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php +53 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php +72 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/RequestMatcher.php +26 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php +35 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php +41 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php +78 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/Stream/BufferedStream.php +270 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php +36 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php +21 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php +37 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php +29 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php +22 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/UriFactory/SlimUriFactory.php +31 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/message/src/filters.php +6 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/CHANGELOG.md +60 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/README.md +37 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/appveyor.yml +39 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/composer.json +43 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php +142 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php +51 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php +27 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php +278 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/CHANGELOG.md +35 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/README.md +49 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/composer.json +35 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/src/FulfilledPromise.php +58 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/src/Promise.php +69 -0
- Postman/Postman-Mail/mailgun/vendor/php-http/promise/src/RejectedPromise.php +58 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/CHANGELOG.md +36 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/LICENSE +19 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/README.md +13 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/composer.json +26 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/MessageInterface.php +187 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/RequestInterface.php +129 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/ResponseInterface.php +68 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/ServerRequestInterface.php +261 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/StreamInterface.php +158 -0
- Postman/Postman-Mail/mailgun/vendor/psr/http-message/src/UploadedFileInterface.php +16 -0
Postman/Postman-Configuration/PostmanConfigurationController.php
CHANGED
@@ -73,11 +73,15 @@ class PostmanConfigurationController {
|
|
73 |
}
|
74 |
// register the stylesheet and javascript external resources
|
75 |
$pluginData = apply_filters( 'postman_get_plugin_metadata', null );
|
|
|
76 |
wp_register_script( 'postman_manual_config_script', plugins_url( 'Postman/Postman-Configuration/postman_manual_config.js', $this->rootPluginFilenameAndPath ), array(
|
77 |
PostmanViewController::JQUERY_SCRIPT,
|
|
|
|
|
78 |
'jquery_validation',
|
79 |
PostmanViewController::POSTMAN_SCRIPT,
|
80 |
), $pluginData ['version'] );
|
|
|
81 |
wp_register_script( 'postman_wizard_script', plugins_url( 'Postman/Postman-Configuration/postman_wizard.js', $this->rootPluginFilenameAndPath ), array(
|
82 |
PostmanViewController::JQUERY_SCRIPT,
|
83 |
'jquery_validation',
|
@@ -145,7 +149,6 @@ class PostmanConfigurationController {
|
|
145 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
146 |
wp_enqueue_style( 'jquery_ui_style' );
|
147 |
wp_enqueue_script( 'postman_manual_config_script' );
|
148 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
149 |
}
|
150 |
|
151 |
/**
|
@@ -222,6 +225,9 @@ class PostmanConfigurationController {
|
|
222 |
print '<div id="sendgrid_settings" class="authentication_setting non-basic non-oauth2">';
|
223 |
do_settings_sections( PostmanSendGridTransport::SENDGRID_AUTH_OPTIONS );
|
224 |
print '</div>';
|
|
|
|
|
|
|
225 |
print '</section>';
|
226 |
print '<section id="message_config">';
|
227 |
do_settings_sections( PostmanAdminController::MESSAGE_SENDER_OPTIONS );
|
73 |
}
|
74 |
// register the stylesheet and javascript external resources
|
75 |
$pluginData = apply_filters( 'postman_get_plugin_metadata', null );
|
76 |
+
|
77 |
wp_register_script( 'postman_manual_config_script', plugins_url( 'Postman/Postman-Configuration/postman_manual_config.js', $this->rootPluginFilenameAndPath ), array(
|
78 |
PostmanViewController::JQUERY_SCRIPT,
|
79 |
+
'jquery-ui-core',
|
80 |
+
'jquery-ui-tabs',
|
81 |
'jquery_validation',
|
82 |
PostmanViewController::POSTMAN_SCRIPT,
|
83 |
), $pluginData ['version'] );
|
84 |
+
|
85 |
wp_register_script( 'postman_wizard_script', plugins_url( 'Postman/Postman-Configuration/postman_wizard.js', $this->rootPluginFilenameAndPath ), array(
|
86 |
PostmanViewController::JQUERY_SCRIPT,
|
87 |
'jquery_validation',
|
149 |
wp_enqueue_style( PostmanViewController::POSTMAN_STYLE );
|
150 |
wp_enqueue_style( 'jquery_ui_style' );
|
151 |
wp_enqueue_script( 'postman_manual_config_script' );
|
|
|
152 |
}
|
153 |
|
154 |
/**
|
225 |
print '<div id="sendgrid_settings" class="authentication_setting non-basic non-oauth2">';
|
226 |
do_settings_sections( PostmanSendGridTransport::SENDGRID_AUTH_OPTIONS );
|
227 |
print '</div>';
|
228 |
+
print '<div id="mailgun_settings" class="authentication_setting non-basic non-oauth2">';
|
229 |
+
do_settings_sections( PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS );
|
230 |
+
print '</div>';
|
231 |
print '</section>';
|
232 |
print '<section id="message_config">';
|
233 |
do_settings_sections( PostmanAdminController::MESSAGE_SENDER_OPTIONS );
|
Postman/Postman-Controller/PostmanWelcomeController.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PostmanWelcomeController {
|
4 |
+
|
5 |
+
private $rootPluginFilenameAndPath, $pluginUrl, $version;
|
6 |
+
|
7 |
+
public function __construct( $rootPluginFilenameAndPath ) {
|
8 |
+
$this->rootPluginFilenameAndPath = $rootPluginFilenameAndPath;
|
9 |
+
$this->pluginUrl = plugins_url( 'style', $rootPluginFilenameAndPath );
|
10 |
+
$this->version = PostmanState::getInstance()->getVersion();
|
11 |
+
|
12 |
+
add_action( 'admin_menu', array( $this, 'add_menus' ) );
|
13 |
+
add_action( 'admin_head', array( $this, 'admin_head' ) );
|
14 |
+
}
|
15 |
+
|
16 |
+
public function add_menus() {
|
17 |
+
|
18 |
+
if ( current_user_can( 'manage_options' ) ) {
|
19 |
+
|
20 |
+
// About
|
21 |
+
add_dashboard_page(
|
22 |
+
__( 'Welcome', Postman::TEXT_DOMAIN ),
|
23 |
+
__( 'Welcome', Postman::TEXT_DOMAIN ),
|
24 |
+
'manage_options',
|
25 |
+
'post-about',
|
26 |
+
array( $this, 'about_screen' )
|
27 |
+
);
|
28 |
+
|
29 |
+
// Credits
|
30 |
+
add_dashboard_page(
|
31 |
+
__( 'Credits', Postman::TEXT_DOMAIN ),
|
32 |
+
__( 'Credits', Postman::TEXT_DOMAIN ),
|
33 |
+
'manage_options',
|
34 |
+
'post-credits',
|
35 |
+
array( $this, 'credits_screen' )
|
36 |
+
);
|
37 |
+
|
38 |
+
// add_action( 'admin_print_styles-' . $page, array( $this, 'postman_about_enqueue_resources' ) );
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
public function admin_head() {
|
43 |
+
remove_submenu_page( 'index.php', 'post-about' );
|
44 |
+
remove_submenu_page( 'index.php', 'post-credits' );
|
45 |
+
}
|
46 |
+
|
47 |
+
public function postman_about_enqueue_resources() {
|
48 |
+
// wp_enqueue_style( 'font-awsome', '' );
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
public function about_screen() {
|
53 |
+
?>
|
54 |
+
<style type="text/css">
|
55 |
+
.post-badge {
|
56 |
+
position: absolute;
|
57 |
+
top: 0;
|
58 |
+
right: 0;
|
59 |
+
padding-top: 142px;
|
60 |
+
height: 50px;
|
61 |
+
width: 140px;
|
62 |
+
color: #000;
|
63 |
+
font-weight: bold;
|
64 |
+
font-size: 14px;
|
65 |
+
text-align: center;
|
66 |
+
margin: 0 -5px;
|
67 |
+
background: url( <?php echo $this->pluginUrl; ?>/images/badge.png) no-repeat;
|
68 |
+
}
|
69 |
+
|
70 |
+
.about-wrap [class$="-col"] {
|
71 |
+
flex-wrap: nowrap !important;
|
72 |
+
}
|
73 |
+
</style>
|
74 |
+
<div class="wrap about-wrap">
|
75 |
+
<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', Postman::TEXT_DOMAIN ), $this->version ); ?></h1>
|
76 |
+
<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! Post SMTP %s is bundled up and ready to take your SMTP needs to the next level!', Postman::TEXT_DOMAIN ), $this->version ); ?><br>
|
77 |
+
<?php printf( '<strong>%s</strong>','Post SMTP support every SMTP service: Gmail/G-suite, SendGrid, Mandrill, Office365, and more...' ); ?>
|
78 |
+
</div>
|
79 |
+
<div class="post-badge"><?php printf( esc_html__( 'Version %s', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
|
80 |
+
|
81 |
+
<h2 class="nav-tab-wrapper">
|
82 |
+
<a class="nav-tab nav-tab-active" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>">
|
83 |
+
<?php esc_html_e( 'What’s New', Postman::TEXT_DOMAIN ); ?>
|
84 |
+
</a><a class="nav-tab" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>">
|
85 |
+
<?php esc_html_e( 'Credits', Postman::TEXT_DOMAIN ); ?>
|
86 |
+
</a>
|
87 |
+
</h2>
|
88 |
+
|
89 |
+
<div class="changelog">
|
90 |
+
<h3><?php esc_html_e( 'Email Log', Postman::TEXT_DOMAIN ); ?></h3>
|
91 |
+
|
92 |
+
<div class="feature-section col two-col">
|
93 |
+
<div class="last-feature">
|
94 |
+
<h4><?php esc_html_e( 'Email log filter', Postman::TEXT_DOMAIN ); ?></h4>
|
95 |
+
<p>
|
96 |
+
<?php esc_html_e( 'You can easily filter by dates and search in your log.', Postman::TEXT_DOMAIN ); ?>
|
97 |
+
<img src="<?php echo $this->pluginUrl; ?>/images/filter-preview.gif">
|
98 |
+
</p>
|
99 |
+
</div>
|
100 |
+
|
101 |
+
<div>
|
102 |
+
<h4><?php esc_html_e( 'Multiple emails resend', Postman::TEXT_DOMAIN ); ?></h4>
|
103 |
+
<p>
|
104 |
+
<?php esc_html_e( 'Resend any email to the original recipient or any other emails you choose.', Postman::TEXT_DOMAIN ); ?>
|
105 |
+
<img src="<?php echo $this->pluginUrl; ?>/images/resend-preview.gif">
|
106 |
+
</p>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<div class="changelog">
|
112 |
+
<h3><?php esc_html_e( 'The best delivery experience', Postman::TEXT_DOMAIN ); ?></h3>
|
113 |
+
|
114 |
+
<div class="feature-section col one-col">
|
115 |
+
<div class="last-feature">
|
116 |
+
<p><?php esc_html_e( 'Easy-to-use, powerful Setup Wizard for perfect configuration,
|
117 |
+
Commercial-grade Connectivity Tester to diagnose server issues,
|
118 |
+
Log and resend all emails; see the exact cause of failed emails,
|
119 |
+
Supports International alphabets, HTML Mail and MultiPart/Alternative,
|
120 |
+
Supports forced recipients (cc, bcc, to) and custom email headers,
|
121 |
+
SASL Support: Plain/Login/CRAM-MD5/XOAUTH2 authentication,
|
122 |
+
Security Support: SMTPS and STARTTLS (SSL/TLS),
|
123 |
+
Copy configuration to other instances of Post.', Postman::TEXT_DOMAIN ); ?></p>
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
|
127 |
+
<div class="feature-section col three-col">
|
128 |
+
<div>
|
129 |
+
<h4><?php esc_html_e( 'Email log HTML preview', Postman::TEXT_DOMAIN ); ?></h4>
|
130 |
+
<p><?php esc_html_e( 'You can now see sent emails as HTML.', Postman::TEXT_DOMAIN ); ?></p>
|
131 |
+
</div>
|
132 |
+
|
133 |
+
<div>
|
134 |
+
<h4><?php esc_html_e( 'Continues email delivery', Postman::TEXT_DOMAIN ); ?></h4>
|
135 |
+
<p><?php esc_html_e( 'if email fail to sent you will get notified using the local mail system.', Postman::TEXT_DOMAIN ); ?></p>
|
136 |
+
</div>
|
137 |
+
|
138 |
+
<div class="last-feature">
|
139 |
+
<h4><?php esc_html_e( 'The best debugging tools.', Postman::TEXT_DOMAIN ); ?></h4>
|
140 |
+
<p><?php esc_html_e( 'Full Transcripts, Connectivity Test, Diagnostic Test.', Postman::TEXT_DOMAIN ); ?></p>
|
141 |
+
</div>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
|
145 |
+
<div class="return-to-dashboard">
|
146 |
+
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></a>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
</div>
|
150 |
+
|
151 |
+
<?php
|
152 |
+
}
|
153 |
+
|
154 |
+
public function credits_screen() {
|
155 |
+
?>
|
156 |
+
<style type="text/css">
|
157 |
+
.post-badge {
|
158 |
+
position: absolute;
|
159 |
+
top: 0;
|
160 |
+
right: 0;
|
161 |
+
padding-top: 142px;
|
162 |
+
height: 50px;
|
163 |
+
width: 140px;
|
164 |
+
color: #000;
|
165 |
+
font-weight: bold;
|
166 |
+
font-size: 14px;
|
167 |
+
text-align: center;
|
168 |
+
margin: 0 -5px;
|
169 |
+
background: url( <?php echo $this->pluginUrl; ?>/images/badge.png) no-repeat;
|
170 |
+
}
|
171 |
+
</style>
|
172 |
+
<div class="wrap about-wrap">
|
173 |
+
<h1><?php printf( esc_html__( 'Welcome to Post SMTP %s', Postman::TEXT_DOMAIN ), $this->version ); ?></h1>
|
174 |
+
<div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
|
175 |
+
<div class="post-badge"><?php printf( esc_html__( 'Version %s', Postman::TEXT_DOMAIN ), $this->version ); ?></div>
|
176 |
+
|
177 |
+
<h2 class="nav-tab-wrapper">
|
178 |
+
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-about' ), 'index.php' ) ) ); ?>" class="nav-tab">
|
179 |
+
<?php esc_html_e( 'What’s New', Postman::TEXT_DOMAIN ); ?>
|
180 |
+
</a><a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'post-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active">
|
181 |
+
<?php esc_html_e( 'Credits', Postman::TEXT_DOMAIN ); ?>
|
182 |
+
</a>
|
183 |
+
</h2>
|
184 |
+
|
185 |
+
<p class="about-description"><?php esc_html_e( 'Post SMTP started by Jason Hendriks, Jason left the project and Yehuda Hassine (me) continue his work.', Postman::TEXT_DOMAIN ); ?></p>
|
186 |
+
|
187 |
+
<h4 class="wp-people-group"><?php esc_html_e( 'Project Leaders', Postman::TEXT_DOMAIN ); ?></h4>
|
188 |
+
<ul class="wp-people-group " id="wp-people-group-project-leaders">
|
189 |
+
<li class="wp-person" id="wp-person-jasonhendriks">
|
190 |
+
<a href="https://profiles.wordpress.org/jasonhendriks"><img src="https://secure.gravatar.com/avatar/8692c7b6084517a592f6cad107f7bcb0?s=60&d=mm&r=g" class="gravatar" alt="Jason Hendriks " /></a>
|
191 |
+
<a class="web" href="http://profiles.wordpress.org/matt">Jason Hendriks</a>
|
192 |
+
<span class="title"><?php esc_html_e( 'Founding Developer (abandoned)', Postman::TEXT_DOMAIN ); ?></span>
|
193 |
+
</li>
|
194 |
+
<li class="wp-person" id="wp-person-yehudah">
|
195 |
+
<a href="http://profiles.wordpress.org/yehudah"><img src="https://secure.gravatar.com/avatar/c561638d04ea8fef351f974dbb9ece39?s=60&d=mm&r=g" class="gravatar" alt="Yehuda Hassine" /></a>
|
196 |
+
<a class="web" href="http://profiles.wordpress.org/yehudah">Yehuda Hassine</a>
|
197 |
+
<span class="title"><?php esc_html_e( 'Lead Developer', Postman::TEXT_DOMAIN ); ?></span>
|
198 |
+
</li>
|
199 |
+
</ul>
|
200 |
+
|
201 |
+
<h4 class="wp-people-group"><?php esc_html_e( 'Top Community Members', Postman::TEXT_DOMAIN ); ?></h4>
|
202 |
+
<h5><?php esc_html_e( 'Here I will list top users that help Post SMTP grow (bugs, features, etc...)', Postman::TEXT_DOMAIN ); ?>
|
203 |
+
<p class="wp-credits-list">
|
204 |
+
<a href="http://profiles.wordpress.org/diegocanal">diegocanal</a>,
|
205 |
+
<a href="http://profiles.wordpress.org/jyourstone">Johan Yourstone</a>,
|
206 |
+
<a href="http://profiles.wordpress.org/bodhirayo">bodhirayo</a>,
|
207 |
+
<a href="http://profiles.wordpress.org/buzztone">Neil Murray </a>,
|
208 |
+
<a href="#">A place waiting for you? :-) </a>
|
209 |
+
</p>
|
210 |
+
|
211 |
+
<div class="return-to-dashboard">
|
212 |
+
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'postman' ), 'admin.php' ) ) ); ?>"><?php esc_html_e( 'Go to Post SMTP Settings', Postman::TEXT_DOMAIN ); ?></a>
|
213 |
+
</div>
|
214 |
+
|
215 |
+
</div>
|
216 |
+
|
217 |
+
<?php
|
218 |
+
}
|
219 |
+
}
|
Postman/Postman-Email-Log/PostmanEmailLogController.php
CHANGED
@@ -360,10 +360,12 @@ class PostmanEmailLogController {
|
|
360 |
$from_date = isset( $_POST['from_date'] ) ? sanitize_text_field( $_POST['from_date'] ) : '';
|
361 |
$to_date = isset( $_POST['to_date'] ) ? sanitize_text_field( $_POST['to_date'] ) : '';
|
362 |
$search = isset( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : '';
|
|
|
|
|
363 |
?>
|
364 |
|
365 |
<form id="postman-email-log-filter" method="post">
|
366 |
-
<div id="email-log-filter">
|
367 |
<div class="form-control">
|
368 |
<label for="from_date"><?php _e( 'From Date', Postman::TEXT_DOMAIN ); ?></label>
|
369 |
<input id="from_date" class="email-log-date" value="<?php echo $from_date; ?>" type="text" name="from_date" placeholder="<?php _e( 'From Date', Postman::TEXT_DOMAIN ); ?>">
|
@@ -377,12 +379,22 @@ class PostmanEmailLogController {
|
|
377 |
<input id="search" type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php _e( 'Search', Postman::TEXT_DOMAIN ); ?>">
|
378 |
</div>
|
379 |
<div class="form-control">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
<button type="submit" name="filter" class="button button-primary"><?php _e( 'Filter', Postman::TEXT_DOMAIN ); ?></button>
|
381 |
-
</div>
|
382 |
-
|
383 |
<div class="form-control">
|
384 |
-
|
385 |
-
</div>
|
386 |
</div>
|
387 |
<div class="error">Please notice: when you select a date for example 11/20/2017, behind the scene the query select <b>11/20/2017 00:00:00</b>.<br>So if you searching for an email arrived that day at any hour you need to select 11/20/2017 as the <b>From Date</b> and 11/21/2017 as the <b>To Date</b>.</div>
|
388 |
</form>
|
360 |
$from_date = isset( $_POST['from_date'] ) ? sanitize_text_field( $_POST['from_date'] ) : '';
|
361 |
$to_date = isset( $_POST['to_date'] ) ? sanitize_text_field( $_POST['to_date'] ) : '';
|
362 |
$search = isset( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : '';
|
363 |
+
$page_records = apply_filters( 'postman_log_per_page', array( 10, 15, 25, 50, 75, 100 ) );
|
364 |
+
$postman_page_records = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : '';
|
365 |
?>
|
366 |
|
367 |
<form id="postman-email-log-filter" method="post">
|
368 |
+
<div id="email-log-filter" class="postman-log-row">
|
369 |
<div class="form-control">
|
370 |
<label for="from_date"><?php _e( 'From Date', Postman::TEXT_DOMAIN ); ?></label>
|
371 |
<input id="from_date" class="email-log-date" value="<?php echo $from_date; ?>" type="text" name="from_date" placeholder="<?php _e( 'From Date', Postman::TEXT_DOMAIN ); ?>">
|
379 |
<input id="search" type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php _e( 'Search', Postman::TEXT_DOMAIN ); ?>">
|
380 |
</div>
|
381 |
<div class="form-control">
|
382 |
+
<label id="postman_page_records"><?php _e( 'Records per page', Postman::TEXT_DOMAIN ); ?></label>
|
383 |
+
<select id="postman_page_records" name="postman_page_records">
|
384 |
+
<?php
|
385 |
+
foreach ( $page_records as $value ) {
|
386 |
+
$selected = selected( $postman_page_records, $value, false );
|
387 |
+
echo '<option value="' . $value . '"' . $selected . '>' . $value . '</option>';
|
388 |
+
}
|
389 |
+
?>
|
390 |
+
</select>
|
391 |
+
</div>
|
392 |
+
<div class="form-control" style="padding: 0 5px 0 5px;">
|
393 |
<button type="submit" name="filter" class="button button-primary"><?php _e( 'Filter', Postman::TEXT_DOMAIN ); ?></button>
|
394 |
+
</div>
|
|
|
395 |
<div class="form-control">
|
396 |
+
<button type="submit" id="postman_trash_all" name="postman_trash_all" class="button button-primary"><?php _e( 'Trash All', Postman::TEXT_DOMAIN ); ?></button>
|
397 |
+
</div>
|
398 |
</div>
|
399 |
<div class="error">Please notice: when you select a date for example 11/20/2017, behind the scene the query select <b>11/20/2017 00:00:00</b>.<br>So if you searching for an email arrived that day at any hour you need to select 11/20/2017 as the <b>From Date</b> and 11/21/2017 as the <b>To Date</b>.</div>
|
400 |
</form>
|
Postman/Postman-Email-Log/PostmanEmailLogService.php
CHANGED
@@ -234,10 +234,10 @@ if ( ! class_exists( 'PostmanEmailLogPurger' ) ) {
|
|
234 |
*
|
235 |
* @return unknown
|
236 |
*/
|
237 |
-
function __construct() {
|
238 |
$this->logger = new PostmanLogger( get_class( $this ) );
|
239 |
-
$
|
240 |
-
'posts_per_page' =>
|
241 |
'offset' => 0,
|
242 |
'category' => '',
|
243 |
'category_name' => '',
|
@@ -253,7 +253,9 @@ if ( ! class_exists( 'PostmanEmailLogPurger' ) ) {
|
|
253 |
'post_status' => 'private',
|
254 |
'suppress_filters' => true,
|
255 |
);
|
256 |
-
$
|
|
|
|
|
257 |
}
|
258 |
|
259 |
/**
|
234 |
*
|
235 |
* @return unknown
|
236 |
*/
|
237 |
+
function __construct( $args = array() ) {
|
238 |
$this->logger = new PostmanLogger( get_class( $this ) );
|
239 |
+
$defaults = array(
|
240 |
+
'posts_per_page' => -1,
|
241 |
'offset' => 0,
|
242 |
'category' => '',
|
243 |
'category_name' => '',
|
253 |
'post_status' => 'private',
|
254 |
'suppress_filters' => true,
|
255 |
);
|
256 |
+
$args = wp_parse_args( $args, $defaults );
|
257 |
+
$query = new WP_Query( $args );
|
258 |
+
$this->posts = $query->posts;
|
259 |
}
|
260 |
|
261 |
/**
|
Postman/Postman-Email-Log/PostmanEmailLogView.php
CHANGED
@@ -260,7 +260,7 @@ class PostmanEmailLogView extends WP_List_Table {
|
|
260 |
/**
|
261 |
* First, lets decide how many records per page to show
|
262 |
*/
|
263 |
-
$per_page = 10;
|
264 |
|
265 |
/**
|
266 |
* REQUIRED.
|
@@ -305,9 +305,9 @@ class PostmanEmailLogView extends WP_List_Table {
|
|
305 |
* be able to use your precisely-queried data immediately.
|
306 |
*/
|
307 |
$data = array();
|
|
|
308 |
$args = array(
|
309 |
-
'posts_per_page' =>
|
310 |
-
'offset' => 0,
|
311 |
'orderby' => 'date',
|
312 |
'order' => 'DESC',
|
313 |
'post_type' => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
|
@@ -339,7 +339,19 @@ class PostmanEmailLogView extends WP_List_Table {
|
|
339 |
$args['s'] = sanitize_text_field( $_POST['search'] );
|
340 |
}
|
341 |
|
|
|
|
|
|
|
342 |
$posts = new WP_query( $args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
$date_format = get_option( 'date_format' );
|
344 |
$time_format = get_option( 'time_format' );
|
345 |
|
260 |
/**
|
261 |
* First, lets decide how many records per page to show
|
262 |
*/
|
263 |
+
$per_page = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : 10;
|
264 |
|
265 |
/**
|
266 |
* REQUIRED.
|
305 |
* be able to use your precisely-queried data immediately.
|
306 |
*/
|
307 |
$data = array();
|
308 |
+
|
309 |
$args = array(
|
310 |
+
'posts_per_page' => -1,
|
|
|
311 |
'orderby' => 'date',
|
312 |
'order' => 'DESC',
|
313 |
'post_type' => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
|
339 |
$args['s'] = sanitize_text_field( $_POST['search'] );
|
340 |
}
|
341 |
|
342 |
+
if ( isset( $_POST['postman_trash_all'] ) ) {
|
343 |
+
$args['posts_per_page'] = -1;
|
344 |
+
}
|
345 |
$posts = new WP_query( $args );
|
346 |
+
|
347 |
+
if ( isset( $_POST['postman_trash_all'] ) ) {
|
348 |
+
foreach ( $posts->posts as $post ) {
|
349 |
+
wp_delete_post( $post->ID, true );
|
350 |
+
}
|
351 |
+
|
352 |
+
$posts->posts = array();
|
353 |
+
}
|
354 |
+
|
355 |
$date_format = get_option( 'date_format' );
|
356 |
$time_format = get_option( 'time_format' );
|
357 |
|
Postman/Postman-Mail/PostmanMailgunMailEngine.php
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'mailgun/mailgun.php';
|
3 |
+
use Mailgun\Mailgun;
|
4 |
+
|
5 |
+
if ( ! class_exists( 'PostmanMailgunMailEngine' ) ) {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Sends mail with the SendGrid API
|
9 |
+
* https://sendgrid.com/docs/API_Reference/Web_API/mail.html
|
10 |
+
*
|
11 |
+
* @author jasonhendriks
|
12 |
+
*/
|
13 |
+
class PostmanMailgunMailEngine implements PostmanMailEngine {
|
14 |
+
|
15 |
+
// logger for all concrete classes - populate with setLogger($logger)
|
16 |
+
protected $logger;
|
17 |
+
|
18 |
+
// the result
|
19 |
+
private $transcript;
|
20 |
+
|
21 |
+
private $apiKey;
|
22 |
+
private $domainName;
|
23 |
+
private $mandrillMessage;
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
* @param unknown $senderEmail
|
28 |
+
* @param unknown $accessToken
|
29 |
+
*/
|
30 |
+
function __construct( $apiKey, $domainName ) {
|
31 |
+
assert( ! empty( $apiKey ) );
|
32 |
+
$this->apiKey = $apiKey;
|
33 |
+
$this->domainName = $domainName;
|
34 |
+
|
35 |
+
// create the logger
|
36 |
+
$this->logger = new PostmanLogger( get_class( $this ) );
|
37 |
+
$this->mailgunMessage = array(
|
38 |
+
'from' => '',
|
39 |
+
'to' => '',
|
40 |
+
'subject' => '',
|
41 |
+
);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* (non-PHPdoc)
|
46 |
+
*
|
47 |
+
* @see PostmanSmtpEngine::send()
|
48 |
+
*/
|
49 |
+
public function send( PostmanMessage $message ) {
|
50 |
+
$options = PostmanOptions::getInstance();
|
51 |
+
|
52 |
+
// add the Postman signature - append it to whatever the user may have set
|
53 |
+
if ( ! $options->isStealthModeEnabled() ) {
|
54 |
+
$pluginData = apply_filters( 'postman_get_plugin_metadata', null );
|
55 |
+
$this->addHeader( 'X-Mailer', sprintf( 'Postman SMTP %s for WordPress (%s)', $pluginData ['version'], 'https://wordpress.org/plugins/post-smtp/' ) );
|
56 |
+
}
|
57 |
+
|
58 |
+
// add the headers - see http://framework.zend.com/manual/1.12/en/zend.mail.additional-headers.html
|
59 |
+
foreach ( ( array ) $message->getHeaders() as $header ) {
|
60 |
+
$this->logger->debug( sprintf( 'Adding user header %s=%s', $header ['name'], $header ['content'] ) );
|
61 |
+
$this->addHeader( $header ['name'], $header ['content'], true );
|
62 |
+
}
|
63 |
+
|
64 |
+
// if the caller set a Content-Type header, use it
|
65 |
+
$contentType = $message->getContentType();
|
66 |
+
if ( ! empty( $contentType ) ) {
|
67 |
+
$this->logger->debug( 'Adding content-type ' . $contentType );
|
68 |
+
$this->addHeader( 'Content-Type', $contentType );
|
69 |
+
}
|
70 |
+
|
71 |
+
// add the From Header
|
72 |
+
$sender = $message->getFromAddress();
|
73 |
+
{
|
74 |
+
$senderEmail = PostmanOptions::getInstance()->getMessageSenderEmail();
|
75 |
+
$senderName = $sender->getName();
|
76 |
+
assert( ! empty( $senderEmail ) );
|
77 |
+
|
78 |
+
$senderText = ! empty( $senderName ) ? $senderName : $senderEmail;
|
79 |
+
$this->mailgunMessage ['from'] = "{$senderText} <{$senderEmail}>";
|
80 |
+
// now log it
|
81 |
+
$sender->log( $this->logger, 'From' );
|
82 |
+
}
|
83 |
+
|
84 |
+
// add the Sender Header, overriding what the user may have set
|
85 |
+
$this->addHeader( 'Sender', $options->getEnvelopeSender() );
|
86 |
+
|
87 |
+
// add the to recipients
|
88 |
+
$recipients = array();
|
89 |
+
foreach ( ( array ) $message->getToRecipients() as $recipient ) {
|
90 |
+
$recipient->log( $this->logger, 'To' );
|
91 |
+
$recipients[] = $recipient->getEmail();
|
92 |
+
}
|
93 |
+
$this->mailgunMessage['to'] = $recipients;
|
94 |
+
|
95 |
+
// add the cc recipients
|
96 |
+
$recipients = array();
|
97 |
+
foreach ( ( array ) $message->getCcRecipients() as $recipient ) {
|
98 |
+
$recipient->log( $this->logger, 'Cc' );
|
99 |
+
$recipients[] = $recipient->getEmail();
|
100 |
+
}
|
101 |
+
$this->mailgunMessage['cc'] = implode( ',', $recipients );
|
102 |
+
|
103 |
+
// add the bcc recipients
|
104 |
+
$recipients = array();
|
105 |
+
foreach ( ( array ) $message->getBccRecipients() as $recipient ) {
|
106 |
+
$recipient->log( $this->logger, 'Bcc' );
|
107 |
+
$recipients[] = $recipient->getEmail();
|
108 |
+
}
|
109 |
+
$this->mailgunMessage['bcc'] = implode( ',', $recipients );
|
110 |
+
|
111 |
+
// add the reply-to
|
112 |
+
$replyTo = $message->getReplyTo();
|
113 |
+
// $replyTo is null or a PostmanEmailAddress object
|
114 |
+
if ( isset( $replyTo ) ) {
|
115 |
+
$this->addHeader( 'reply-to', $replyTo->format() );
|
116 |
+
}
|
117 |
+
|
118 |
+
// add the date
|
119 |
+
$date = $message->getDate();
|
120 |
+
if ( ! empty( $date ) ) {
|
121 |
+
$this->addHeader( 'date', $message->getDate() );
|
122 |
+
}
|
123 |
+
|
124 |
+
// add the messageId
|
125 |
+
$messageId = $message->getMessageId();
|
126 |
+
if ( ! empty( $messageId ) ) {
|
127 |
+
$this->addHeader( 'message-id', $messageId );
|
128 |
+
}
|
129 |
+
|
130 |
+
// add the subject
|
131 |
+
if ( null !== $message->getSubject() ) {
|
132 |
+
$this->mailgunMessage ['subject'] = $message->getSubject();
|
133 |
+
}
|
134 |
+
|
135 |
+
// add the message content
|
136 |
+
{
|
137 |
+
$textPart = $message->getBodyTextPart();
|
138 |
+
if ( ! empty( $textPart ) ) {
|
139 |
+
$this->logger->debug( 'Adding body as text' );
|
140 |
+
$this->mailgunMessage ['text'] = $textPart;
|
141 |
+
}
|
142 |
+
$htmlPart = $message->getBodyHtmlPart();
|
143 |
+
if ( ! empty( $htmlPart ) ) {
|
144 |
+
$this->logger->debug( 'Adding body as html' );
|
145 |
+
$this->mailgunMessage ['html'] = $htmlPart;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
// add attachments
|
150 |
+
$this->logger->debug( 'Adding attachments' );
|
151 |
+
$this->addAttachmentsToMail( $message );
|
152 |
+
|
153 |
+
$result = array();
|
154 |
+
try {
|
155 |
+
if ( $this->logger->isDebug() ) {
|
156 |
+
$this->logger->debug( 'Creating Mandrill service with apiKey=' . $this->apiKey );
|
157 |
+
}
|
158 |
+
|
159 |
+
// send the message
|
160 |
+
if ( $this->logger->isDebug() ) {
|
161 |
+
$this->logger->debug( 'Sending mail' );
|
162 |
+
}
|
163 |
+
|
164 |
+
$mg = Mailgun::create( $this->apiKey );
|
165 |
+
|
166 |
+
// Make the call to the client.
|
167 |
+
$result = $this->processSend( $mg );
|
168 |
+
|
169 |
+
if ( $this->logger->isInfo() ) {
|
170 |
+
$this->logger->info( sprintf( 'Message %d accepted for delivery', PostmanState::getInstance()->getSuccessfulDeliveries() + 1 ) );
|
171 |
+
}
|
172 |
+
|
173 |
+
$this->transcript = print_r( $result, true );
|
174 |
+
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
|
175 |
+
$this->transcript .= print_r( $this->mailgunMessage, true );
|
176 |
+
} catch ( Exception $e ) {
|
177 |
+
$this->transcript = $e->getMessage();
|
178 |
+
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
|
179 |
+
$this->transcript .= print_r( $this->mailgunMessage, true );
|
180 |
+
throw $e;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
|
185 |
+
private function processSend( $mg ) {
|
186 |
+
|
187 |
+
if ( count( $this->mailgunMessage['to'] ) == 1 ) {
|
188 |
+
|
189 |
+
return $mg->messages()->send( $this->domainName, array_filter( $this->mailgunMessage ) );
|
190 |
+
} else {
|
191 |
+
$chunks = array_chunk( $this->mailgunMessage['to'], 1000, true );
|
192 |
+
|
193 |
+
$result = array();
|
194 |
+
foreach ( $chunks as $key => $emails ) {
|
195 |
+
$this->mailgunMessage['to'] = $emails;
|
196 |
+
$recipient_variables = $this->getRecipientVariables( $emails );
|
197 |
+
$this->mailgunMessage['recipient-variables'] = $recipient_variables;
|
198 |
+
|
199 |
+
$result[] = $mg->messages()->send( $this->domainName, array_filter( $this->mailgunMessage ) );
|
200 |
+
|
201 |
+
// Don't have a reason just wait a bit before sending the next chunk
|
202 |
+
sleep(2);
|
203 |
+
}
|
204 |
+
|
205 |
+
return $result;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
private function getRecipientVariables( $emails ) {
|
210 |
+
$recipient_variables = array();
|
211 |
+
foreach ( $emails as $key => $email ) {
|
212 |
+
$recipient_variables[$email] = array( 'id' => $key );
|
213 |
+
}
|
214 |
+
|
215 |
+
return json_encode( $recipient_variables );
|
216 |
+
}
|
217 |
+
|
218 |
+
private function addHeader( $name, $value, $deprecated = '' ) {
|
219 |
+
if ( $value && ! empty( $value ) ) {
|
220 |
+
$this->mailgunMessage['h:' . $name] = $value;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
* Add attachments to the message
|
226 |
+
*
|
227 |
+
* @param Postman_Zend_Mail $mail
|
228 |
+
*/
|
229 |
+
private function addAttachmentsToMail( PostmanMessage $message ) {
|
230 |
+
$attachments = $message->getAttachments();
|
231 |
+
if ( ! is_array( $attachments ) ) {
|
232 |
+
// WordPress may a single filename or a newline-delimited string list of multiple filenames
|
233 |
+
$attArray[] = explode( PHP_EOL, $attachments );
|
234 |
+
} else {
|
235 |
+
$attArray = $attachments;
|
236 |
+
}
|
237 |
+
|
238 |
+
$attachments = array();
|
239 |
+
foreach ( $attArray as $file ) {
|
240 |
+
if ( ! empty( $file ) ) {
|
241 |
+
$this->logger->debug( 'Adding attachment: ' . $file );
|
242 |
+
$attachments[] = array( 'filePath' => $file );
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
if ( ! empty( $attachments ) ) {
|
247 |
+
if ( $this->logger->isTrace() ) {
|
248 |
+
$this->logger->trace( $attachments );
|
249 |
+
}
|
250 |
+
$this->mailgunMessage['attachment'] = $attachments;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
// return the SMTP session transcript
|
255 |
+
public function getTranscript() {
|
256 |
+
return $this->transcript;
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
Postman/Postman-Mail/PostmanMailgunTransport.php
ADDED
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'PostmanModuleTransport.php';
|
3 |
+
/**
|
4 |
+
* Postman Mailgun module
|
5 |
+
*
|
6 |
+
* @author jasonhendriks
|
7 |
+
*/
|
8 |
+
class PostmanMailgunTransport extends PostmanAbstractModuleTransport implements PostmanModuleTransport {
|
9 |
+
const SLUG = 'mailgun_api';
|
10 |
+
const PORT = 443;
|
11 |
+
const HOST = 'api.mailgun.net';
|
12 |
+
const PRIORITY = 8000;
|
13 |
+
const MAILGUN_AUTH_OPTIONS = 'postman_mailgun_auth_options';
|
14 |
+
const MAILGUN_AUTH_SECTION = 'postman_mailgun_auth_section';
|
15 |
+
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
* @param unknown $rootPluginFilenameAndPath
|
19 |
+
*/
|
20 |
+
public function __construct( $rootPluginFilenameAndPath ) {
|
21 |
+
parent::__construct( $rootPluginFilenameAndPath );
|
22 |
+
|
23 |
+
// add a hook on the plugins_loaded event
|
24 |
+
add_action( 'admin_init', array(
|
25 |
+
$this,
|
26 |
+
'on_admin_init',
|
27 |
+
) );
|
28 |
+
}
|
29 |
+
public function getProtocol() {
|
30 |
+
return 'https';
|
31 |
+
}
|
32 |
+
|
33 |
+
// this should be standard across all transports
|
34 |
+
public function getSlug() {
|
35 |
+
return self::SLUG;
|
36 |
+
}
|
37 |
+
public function getName() {
|
38 |
+
return __( 'Mailgun API', Postman::TEXT_DOMAIN );
|
39 |
+
}
|
40 |
+
/**
|
41 |
+
* v0.2.1
|
42 |
+
*
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public function getHostname() {
|
46 |
+
return self::HOST;
|
47 |
+
}
|
48 |
+
/**
|
49 |
+
* v0.2.1
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getPort() {
|
54 |
+
return self::PORT;
|
55 |
+
}
|
56 |
+
/**
|
57 |
+
* v1.7.0
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function getTransportType() {
|
62 |
+
return 'Mailgun_api';
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* (non-PHPdoc)
|
67 |
+
*
|
68 |
+
* @see PostmanModuleTransport::createMailEngine()
|
69 |
+
*/
|
70 |
+
public function createMailEngine() {
|
71 |
+
$apiKey = $this->options->getMailgunApiKey();
|
72 |
+
$domainName = $this->options->getMailgunDomainName();
|
73 |
+
|
74 |
+
require_once 'PostmanMailgunMailEngine.php';
|
75 |
+
$engine = new PostmanMailgunMailEngine( $apiKey, $domainName );
|
76 |
+
return $engine;
|
77 |
+
}
|
78 |
+
public function getDeliveryDetails() {
|
79 |
+
/* translators: where (1) is the secure icon and (2) is the transport name */
|
80 |
+
return sprintf( __( 'Post SMTP will send mail via the <b>%1$s %2$s</b>.', Postman::TEXT_DOMAIN ), '🔐', $this->getName() );
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
*
|
85 |
+
* @param unknown $data
|
86 |
+
*/
|
87 |
+
public function prepareOptionsForExport( $data ) {
|
88 |
+
$data = parent::prepareOptionsForExport( $data );
|
89 |
+
$data [ PostmanOptions::MAILGUN_API_KEY ] = PostmanOptions::getInstance()->getMailgunApiKey();
|
90 |
+
return $data;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* (non-PHPdoc)
|
95 |
+
*
|
96 |
+
* @see PostmanTransport::getMisconfigurationMessage()
|
97 |
+
*/
|
98 |
+
protected function validateTransportConfiguration() {
|
99 |
+
$messages = parent::validateTransportConfiguration();
|
100 |
+
$apiKey = $this->options->getMailgunApiKey();
|
101 |
+
$domainName = $this->options->getMailgunDomainName();
|
102 |
+
|
103 |
+
if ( empty( $apiKey ) ) {
|
104 |
+
array_push( $messages, __( 'API Key can not be empty', Postman::TEXT_DOMAIN ) . '.' );
|
105 |
+
$this->setNotConfiguredAndReady();
|
106 |
+
}
|
107 |
+
|
108 |
+
if ( empty( $domainName ) ) {
|
109 |
+
array_push( $messages, __( 'Domain Name can not be empty', Postman::TEXT_DOMAIN ) . '.' );
|
110 |
+
$this->setNotConfiguredAndReady();
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( ! $this->isSenderConfigured() ) {
|
114 |
+
array_push( $messages, __( 'Message From Address can not be empty', Postman::TEXT_DOMAIN ) . '.' );
|
115 |
+
$this->setNotConfiguredAndReady();
|
116 |
+
}
|
117 |
+
return $messages;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* (non-PHPdoc)
|
122 |
+
*
|
123 |
+
* @see PostmanModuleTransport::getConfigurationBid()
|
124 |
+
*/
|
125 |
+
public function getConfigurationBid( PostmanWizardSocket $hostData, $userAuthOverride, $originalSmtpServer ) {
|
126 |
+
$recommendation = array();
|
127 |
+
$recommendation ['priority'] = 0;
|
128 |
+
$recommendation ['transport'] = self::SLUG;
|
129 |
+
$recommendation ['hostname'] = null; // scribe looks this
|
130 |
+
$recommendation ['label'] = $this->getName();
|
131 |
+
if ( $hostData->hostname == self::HOST && $hostData->port == self::PORT ) {
|
132 |
+
$recommendation ['priority'] = self::PRIORITY;
|
133 |
+
/* translators: where variables are (1) transport name (2) host and (3) port */
|
134 |
+
$recommendation ['message'] = sprintf( __( ('Postman recommends the %1$s to host %2$s on port %3$d.') ), $this->getName(), self::HOST, self::PORT );
|
135 |
+
}
|
136 |
+
return $recommendation;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
*
|
141 |
+
* @param unknown $hostname
|
142 |
+
* @param unknown $response
|
143 |
+
*/
|
144 |
+
public function populateConfiguration( $hostname ) {
|
145 |
+
$response = parent::populateConfiguration( $hostname );
|
146 |
+
return $response;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
*/
|
151 |
+
public function createOverrideMenu( PostmanWizardSocket $socket, $winningRecommendation, $userSocketOverride, $userAuthOverride ) {
|
152 |
+
$overrideItem = parent::createOverrideMenu( $socket, $winningRecommendation, $userSocketOverride, $userAuthOverride );
|
153 |
+
// push the authentication options into the $overrideItem structure
|
154 |
+
$overrideItem ['auth_items'] = array(
|
155 |
+
array(
|
156 |
+
'selected' => true,
|
157 |
+
'name' => __( 'API Key', Postman::TEXT_DOMAIN ),
|
158 |
+
'value' => 'api_key',
|
159 |
+
),
|
160 |
+
);
|
161 |
+
return $overrideItem;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Functions to execute on the admin_init event
|
166 |
+
*
|
167 |
+
* "Runs at the beginning of every admin page before the page is rendered."
|
168 |
+
* ref: http://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_an_Admin_Page_Request
|
169 |
+
*/
|
170 |
+
public function on_admin_init() {
|
171 |
+
// only administrators should be able to trigger this
|
172 |
+
if ( PostmanUtils::isAdmin() ) {
|
173 |
+
$this->addSettings();
|
174 |
+
$this->registerStylesAndScripts();
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
/*
|
179 |
+
* What follows in the code responsible for creating the Admin Settings page
|
180 |
+
*/
|
181 |
+
|
182 |
+
/**
|
183 |
+
*/
|
184 |
+
public function addSettings() {
|
185 |
+
// the Mailgun Auth section
|
186 |
+
add_settings_section( PostmanMailgunTransport::MAILGUN_AUTH_SECTION, __( 'Authentication', Postman::TEXT_DOMAIN ), array(
|
187 |
+
$this,
|
188 |
+
'printMailgunAuthSectionInfo',
|
189 |
+
), PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS );
|
190 |
+
|
191 |
+
add_settings_field( PostmanOptions::MAILGUN_API_KEY, __( 'API Key', Postman::TEXT_DOMAIN ), array(
|
192 |
+
$this,
|
193 |
+
'mailgun_api_key_callback',
|
194 |
+
), PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS, PostmanMailgunTransport::MAILGUN_AUTH_SECTION );
|
195 |
+
|
196 |
+
add_settings_field( PostmanOptions::MAILGUN_DOMAIN_NAME, __( 'Domain Name', Postman::TEXT_DOMAIN ), array(
|
197 |
+
$this,
|
198 |
+
'mailgun_domain_name_callback',
|
199 |
+
), PostmanMailgunTransport::MAILGUN_AUTH_OPTIONS, PostmanMailgunTransport::MAILGUN_AUTH_SECTION );
|
200 |
+
}
|
201 |
+
public function printMailgunAuthSectionInfo() {
|
202 |
+
/* Translators: Where (1) is the service URL and (2) is the service name and (3) is a api key URL */
|
203 |
+
printf( '<p id="wizard_mailgun_auth_help">%s</p>', sprintf( __( 'Create an account at <a href="%1$s" target="_blank">%2$s</a> and enter <a href="%3$s" target="_blank">an API key</a> below.', Postman::TEXT_DOMAIN ), 'https://mailgun.com', 'mailgun.com', 'https://app.mailgun.com/app/domains/' ) );
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
*/
|
208 |
+
public function mailgun_api_key_callback() {
|
209 |
+
printf( '<input type="password" autocomplete="off" id="mailgun_api_key" name="postman_options[mailgun_api_key]" value="%s" size="60" class="required" placeholder="%s"/>', null !== $this->options->getMailgunApiKey() ? esc_attr( PostmanUtils::obfuscatePassword( $this->options->getMailgunApiKey() ) ) : '', __( 'Required', Postman::TEXT_DOMAIN ) );
|
210 |
+
print '<input type="button" id="toggleMailgunApiKey" value="Show Password" class="button button-secondary" style="visibility:hidden" />';
|
211 |
+
}
|
212 |
+
|
213 |
+
function mailgun_domain_name_callback() {
|
214 |
+
printf( '<input type="text" autocomplete="off" id="mailgun_domain_name" name="postman_options[mailgun_domain_name]" value="%s" size="60" class="required" placeholder="%s"/>', null !== $this->options->getMailgunDomainName() ? esc_attr( $this->options->getMailgunDomainName() ) : '', __( 'Required', Postman::TEXT_DOMAIN ) );
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
*/
|
219 |
+
public function registerStylesAndScripts() {
|
220 |
+
// register the stylesheet and javascript external resources
|
221 |
+
$pluginData = apply_filters( 'postman_get_plugin_metadata', null );
|
222 |
+
wp_register_script( 'postman_mailgun_script', plugins_url( 'Postman/Postman-Mail/postman_mailgun.js', $this->rootPluginFilenameAndPath ), array(
|
223 |
+
PostmanViewController::JQUERY_SCRIPT,
|
224 |
+
'jquery_validation',
|
225 |
+
PostmanViewController::POSTMAN_SCRIPT,
|
226 |
+
), $pluginData ['version'] );
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
*/
|
231 |
+
public function enqueueScript() {
|
232 |
+
wp_enqueue_script( 'postman_mailgun_script' );
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
*/
|
237 |
+
public function printWizardAuthenticationStep() {
|
238 |
+
print '<section class="wizard_mailgun">';
|
239 |
+
$this->printMailgunAuthSectionInfo();
|
240 |
+
printf( '<label for="api_key">%s</label>', __( 'API Key', Postman::TEXT_DOMAIN ) );
|
241 |
+
print '<br />';
|
242 |
+
print $this->mailgun_api_key_callback();
|
243 |
+
printf( '<label for="domain_name">%s</label>', __( 'Domain Name', Postman::TEXT_DOMAIN ) );
|
244 |
+
print '<br />';
|
245 |
+
print $this->mailgun_domain_name_callback();
|
246 |
+
print '</section>';
|
247 |
+
}
|
248 |
+
}
|
Postman/Postman-Mail/PostmanMessage.php
CHANGED
@@ -35,7 +35,7 @@ if ( ! class_exists( 'PostmanMessage' ) ) {
|
|
35 |
|
36 |
// determined by the send() method
|
37 |
private $isTextHtml;
|
38 |
-
private $contentType;
|
39 |
private $charset;
|
40 |
|
41 |
private $boundary;
|
@@ -81,7 +81,7 @@ if ( ! class_exists( 'PostmanMessage' ) ) {
|
|
81 |
$this->contentType = sprintf( "%s;\r\n\t boundary=\"%s\"", $this->contentType, $this->getBoundary() );
|
82 |
}
|
83 |
|
84 |
-
|
85 |
$contentType = $this->getContentType();
|
86 |
// add the message content as either text or html
|
87 |
if ( empty( $contentType ) || substr( $contentType, 0, 10 ) === 'text/plain' ) {
|
35 |
|
36 |
// determined by the send() method
|
37 |
private $isTextHtml;
|
38 |
+
private $contentType = 'text/plain';
|
39 |
private $charset;
|
40 |
|
41 |
private $boundary;
|
81 |
$this->contentType = sprintf( "%s;\r\n\t boundary=\"%s\"", $this->contentType, $this->getBoundary() );
|
82 |
}
|
83 |
|
84 |
+
$body = $this->getBody();
|
85 |
$contentType = $this->getContentType();
|
86 |
// add the message content as either text or html
|
87 |
if ( empty( $contentType ) || substr( $contentType, 0, 10 ) === 'text/plain' ) {
|
Postman/Postman-Mail/PostmanTransportRegistry.php
CHANGED
@@ -5,34 +5,33 @@ require_once 'PostmanZendMailTransportConfigurationFactory.php';
|
|
5 |
/**
|
6 |
*
|
7 |
* @author jasonhendriks
|
8 |
-
*
|
9 |
*/
|
10 |
class PostmanTransportRegistry {
|
11 |
private $transports;
|
12 |
private $logger;
|
13 |
-
|
14 |
/**
|
15 |
*/
|
16 |
private function __construct() {
|
17 |
-
$this->logger = new PostmanLogger
|
18 |
}
|
19 |
-
|
20 |
// singleton instance
|
21 |
public static function getInstance() {
|
22 |
static $inst = null;
|
23 |
-
if ($inst === null) {
|
24 |
-
$inst = new PostmanTransportRegistry
|
25 |
}
|
26 |
return $inst;
|
27 |
}
|
28 |
-
public function registerTransport(PostmanModuleTransport $instance) {
|
29 |
-
$this->transports [$instance->getSlug
|
30 |
$instance->init();
|
31 |
}
|
32 |
public function getTransports() {
|
33 |
return $this->transports;
|
34 |
}
|
35 |
-
|
36 |
/**
|
37 |
* Retrieve a Transport by slug
|
38 |
* Look up a specific Transport use:
|
@@ -40,85 +39,84 @@ class PostmanTransportRegistry {
|
|
40 |
* B) when querying what a theoretical scenario involving this transport is like
|
41 |
* (ie.for ajax in config screen)
|
42 |
*
|
43 |
-
* @param unknown $slug
|
44 |
*/
|
45 |
-
public function getTransport($slug) {
|
46 |
-
$transports = $this->getTransports
|
47 |
-
if (isset
|
48 |
-
return $transports [$slug];
|
49 |
}
|
50 |
}
|
51 |
-
|
52 |
/**
|
53 |
* A short-hand way of showing the complete delivery method
|
54 |
*
|
55 |
-
* @param PostmanModuleTransport $transport
|
56 |
* @return string
|
57 |
*/
|
58 |
-
public function getPublicTransportUri(PostmanModuleTransport $transport) {
|
59 |
-
return $transport->getPublicTransportUri
|
60 |
}
|
61 |
-
|
62 |
/**
|
63 |
* Determine if a specific transport is registered in the directory.
|
64 |
*
|
65 |
-
* @param unknown $slug
|
66 |
*/
|
67 |
-
public function isRegistered($slug) {
|
68 |
-
$transports = $this->getTransports
|
69 |
-
return isset
|
70 |
}
|
71 |
-
|
72 |
/**
|
73 |
* Retrieve the transport Postman is currently configured with.
|
74 |
*
|
75 |
* @return PostmanDummyTransport|PostmanModuleTransport
|
76 |
* @deprecated
|
77 |
-
*
|
78 |
*/
|
79 |
public function getCurrentTransport() {
|
80 |
-
$selectedTransport = PostmanOptions::getInstance
|
81 |
-
$transports = $this->getTransports
|
82 |
-
if (! isset
|
83 |
return $transports ['default'];
|
84 |
} else {
|
85 |
-
return $transports [$selectedTransport];
|
86 |
}
|
87 |
}
|
88 |
-
|
89 |
/**
|
90 |
*
|
91 |
-
* @param PostmanOptions
|
92 |
-
* @param PostmanOAuthToken $token
|
93 |
* @return boolean
|
94 |
*/
|
95 |
public function getActiveTransport() {
|
96 |
-
$selectedTransport = PostmanOptions::getInstance
|
97 |
-
$transports = $this->getTransports
|
98 |
-
if (isset
|
99 |
-
$transport = $transports [$selectedTransport];
|
100 |
-
if ($transport->getSlug
|
101 |
return $transport;
|
102 |
}
|
103 |
}
|
104 |
return $transports ['default'];
|
105 |
}
|
106 |
-
|
107 |
/**
|
108 |
* Retrieve the transport Postman is currently configured with.
|
109 |
*
|
110 |
* @return PostmanDummyTransport|PostmanModuleTransport
|
111 |
*/
|
112 |
public function getSelectedTransport() {
|
113 |
-
$selectedTransport = PostmanOptions::getInstance
|
114 |
-
$transports = $this->getTransports
|
115 |
-
if (isset
|
116 |
-
return $transports [$selectedTransport];
|
117 |
} else {
|
118 |
return $transports ['default'];
|
119 |
}
|
120 |
}
|
121 |
-
|
122 |
/**
|
123 |
* Determine whether to show the Request Permission link on the main menu
|
124 |
*
|
@@ -127,47 +125,52 @@ class PostmanTransportRegistry {
|
|
127 |
* 2. the transport is properly configured
|
128 |
* 3. we have a valid Client ID and Client Secret without an Auth Token
|
129 |
*
|
130 |
-
* @param PostmanOptions $options
|
131 |
* @return boolean
|
132 |
*/
|
133 |
-
public function isRequestOAuthPermissionAllowed(PostmanOptions $options, PostmanOAuthToken $authToken) {
|
134 |
// does the current transport use OAuth 2.0
|
135 |
-
$oauthUsed = self::getSelectedTransport
|
136 |
-
|
137 |
// is the transport configured
|
138 |
-
if ($oauthUsed) {
|
139 |
-
$configured = self::getSelectedTransport
|
140 |
}
|
141 |
-
|
142 |
return $oauthUsed && $configured;
|
143 |
}
|
144 |
-
|
145 |
/**
|
146 |
* Polls all the installed transports to get a complete list of sockets to probe for connectivity
|
147 |
*
|
148 |
-
* @param unknown $hostname
|
149 |
-
* @param unknown $isGmail
|
150 |
* @return multitype:
|
151 |
*/
|
152 |
-
public function getSocketsForSetupWizardToProbe($hostname = 'localhost', $smtpServerGuess = null) {
|
153 |
-
$hosts = array
|
154 |
-
if ($this->logger->isDebug
|
155 |
-
$this->logger->debug
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
-
foreach ( $
|
158 |
-
$socketsToTest = $transport->getSocketsForSetupWizardToProbe
|
159 |
-
if ($this->logger->isTrace
|
160 |
-
$this->logger->trace
|
161 |
-
$this->logger->trace
|
162 |
}
|
163 |
-
$hosts = array_merge
|
164 |
-
if ($this->logger->isDebug
|
165 |
-
$this->logger->debug
|
166 |
}
|
167 |
}
|
168 |
return $hosts;
|
169 |
}
|
170 |
-
|
171 |
/**
|
172 |
* If the host port is a possible configuration option, recommend it
|
173 |
*
|
@@ -175,63 +178,63 @@ class PostmanTransportRegistry {
|
|
175 |
*
|
176 |
* response should include ['success'], ['message'], ['priority']
|
177 |
*
|
178 |
-
* @param unknown $hostData
|
179 |
*/
|
180 |
-
public function getRecommendation(PostmanWizardSocket $hostData, $userAuthOverride, $originalSmtpServer) {
|
181 |
-
$scrubbedUserAuthOverride = $this->scrubUserOverride
|
182 |
-
$transport = $this->getTransport
|
183 |
-
$recommendation = $transport->getConfigurationBid
|
184 |
-
if ($this->logger->isDebug
|
185 |
-
$this->logger->debug
|
186 |
}
|
187 |
return $recommendation;
|
188 |
}
|
189 |
-
|
190 |
/**
|
191 |
*
|
192 |
-
* @param PostmanWizardSocket $hostData
|
193 |
-
* @param unknown
|
194 |
* @return NULL
|
195 |
*/
|
196 |
-
private function scrubUserOverride(PostmanWizardSocket $hostData, $userAuthOverride) {
|
197 |
-
$this->logger->trace
|
198 |
-
|
199 |
// validate userAuthOverride
|
200 |
-
if (! ($userAuthOverride == 'oauth2' || $userAuthOverride == 'password' || $userAuthOverride == 'none')) {
|
201 |
$userAuthOverride = null;
|
202 |
}
|
203 |
-
|
204 |
// validate the userAuthOverride
|
205 |
-
if (! $hostData->auth_xoauth) {
|
206 |
-
if ($userAuthOverride == 'oauth2') {
|
207 |
$userAuthOverride = null;
|
208 |
}
|
209 |
}
|
210 |
-
if (! $hostData->auth_crammd5 && ! $hostData->authPlain && ! $hostData->auth_login) {
|
211 |
-
if ($userAuthOverride == 'password') {
|
212 |
$userAuthOverride = null;
|
213 |
}
|
214 |
}
|
215 |
-
if (! $hostData->auth_none) {
|
216 |
-
if ($userAuthOverride == 'none') {
|
217 |
$userAuthOverride = null;
|
218 |
}
|
219 |
}
|
220 |
-
$this->logger->trace
|
221 |
return $userAuthOverride;
|
222 |
}
|
223 |
-
|
224 |
/**
|
225 |
*/
|
226 |
public function getReadyMessage() {
|
227 |
-
if ($this->getCurrentTransport
|
228 |
-
if (PostmanOptions::getInstance
|
229 |
-
return __
|
230 |
} else {
|
231 |
-
return __
|
232 |
}
|
233 |
} else {
|
234 |
-
return __
|
235 |
}
|
236 |
}
|
237 |
}
|
5 |
/**
|
6 |
*
|
7 |
* @author jasonhendriks
|
|
|
8 |
*/
|
9 |
class PostmanTransportRegistry {
|
10 |
private $transports;
|
11 |
private $logger;
|
12 |
+
|
13 |
/**
|
14 |
*/
|
15 |
private function __construct() {
|
16 |
+
$this->logger = new PostmanLogger( get_class( $this ) );
|
17 |
}
|
18 |
+
|
19 |
// singleton instance
|
20 |
public static function getInstance() {
|
21 |
static $inst = null;
|
22 |
+
if ( $inst === null ) {
|
23 |
+
$inst = new PostmanTransportRegistry();
|
24 |
}
|
25 |
return $inst;
|
26 |
}
|
27 |
+
public function registerTransport( PostmanModuleTransport $instance ) {
|
28 |
+
$this->transports [ $instance->getSlug() ] = $instance;
|
29 |
$instance->init();
|
30 |
}
|
31 |
public function getTransports() {
|
32 |
return $this->transports;
|
33 |
}
|
34 |
+
|
35 |
/**
|
36 |
* Retrieve a Transport by slug
|
37 |
* Look up a specific Transport use:
|
39 |
* B) when querying what a theoretical scenario involving this transport is like
|
40 |
* (ie.for ajax in config screen)
|
41 |
*
|
42 |
+
* @param unknown $slug
|
43 |
*/
|
44 |
+
public function getTransport( $slug ) {
|
45 |
+
$transports = $this->getTransports();
|
46 |
+
if ( isset( $transports [ $slug ] ) ) {
|
47 |
+
return $transports [ $slug ];
|
48 |
}
|
49 |
}
|
50 |
+
|
51 |
/**
|
52 |
* A short-hand way of showing the complete delivery method
|
53 |
*
|
54 |
+
* @param PostmanModuleTransport $transport
|
55 |
* @return string
|
56 |
*/
|
57 |
+
public function getPublicTransportUri( PostmanModuleTransport $transport ) {
|
58 |
+
return $transport->getPublicTransportUri();
|
59 |
}
|
60 |
+
|
61 |
/**
|
62 |
* Determine if a specific transport is registered in the directory.
|
63 |
*
|
64 |
+
* @param unknown $slug
|
65 |
*/
|
66 |
+
public function isRegistered( $slug ) {
|
67 |
+
$transports = $this->getTransports();
|
68 |
+
return isset( $transports [ $slug ] );
|
69 |
}
|
70 |
+
|
71 |
/**
|
72 |
* Retrieve the transport Postman is currently configured with.
|
73 |
*
|
74 |
* @return PostmanDummyTransport|PostmanModuleTransport
|
75 |
* @deprecated
|
|
|
76 |
*/
|
77 |
public function getCurrentTransport() {
|
78 |
+
$selectedTransport = PostmanOptions::getInstance()->getTransportType();
|
79 |
+
$transports = $this->getTransports();
|
80 |
+
if ( ! isset( $transports [ $selectedTransport ] ) ) {
|
81 |
return $transports ['default'];
|
82 |
} else {
|
83 |
+
return $transports [ $selectedTransport ];
|
84 |
}
|
85 |
}
|
86 |
+
|
87 |
/**
|
88 |
*
|
89 |
+
* @param PostmanOptions $options
|
90 |
+
* @param PostmanOAuthToken $token
|
91 |
* @return boolean
|
92 |
*/
|
93 |
public function getActiveTransport() {
|
94 |
+
$selectedTransport = PostmanOptions::getInstance()->getTransportType();
|
95 |
+
$transports = $this->getTransports();
|
96 |
+
if ( isset( $transports [ $selectedTransport ] ) ) {
|
97 |
+
$transport = $transports [ $selectedTransport ];
|
98 |
+
if ( $transport->getSlug() == $selectedTransport && $transport->isConfiguredAndReady() ) {
|
99 |
return $transport;
|
100 |
}
|
101 |
}
|
102 |
return $transports ['default'];
|
103 |
}
|
104 |
+
|
105 |
/**
|
106 |
* Retrieve the transport Postman is currently configured with.
|
107 |
*
|
108 |
* @return PostmanDummyTransport|PostmanModuleTransport
|
109 |
*/
|
110 |
public function getSelectedTransport() {
|
111 |
+
$selectedTransport = PostmanOptions::getInstance()->getTransportType();
|
112 |
+
$transports = $this->getTransports();
|
113 |
+
if ( isset( $transports [ $selectedTransport ] ) ) {
|
114 |
+
return $transports [ $selectedTransport ];
|
115 |
} else {
|
116 |
return $transports ['default'];
|
117 |
}
|
118 |
}
|
119 |
+
|
120 |
/**
|
121 |
* Determine whether to show the Request Permission link on the main menu
|
122 |
*
|
125 |
|