This repository has been archived by the owner. It is now read-only.
Permalink
Please sign in to comment.
Showing
with
4,874 additions
and 0 deletions.
- +40 −0 DependencyInjection/Configuration.php
- +61 −0 DependencyInjection/PostmarkappPostmarkExtension.php
- +8 −0 Postmark/Adapter_Interface.php
- +61 −0 Postmark/CHANGELOG.md
- +3,509 −0 Postmark/Certificate/cacert.pem
- +625 −0 Postmark/Mail_Postmark.php
- +122 −0 Postmark/README.md
- +35 −0 Postmark/Tests/Adapter.php
- +18 −0 Postmark/Tests/Constants.php
- +71 −0 Postmark/Tests/Tests_Attachment.php
- +161 −0 Postmark/Tests/Tests_Base.php
- +35 −0 Postmark/Tests/Tests_Log.php
- +18 −0 PostmarkappPostmarkBundle.php
- +58 −0 README.mkd
- +21 −0 Resources/config/postmark.xml
- +31 −0 Services/Postmark.php
@@ -0,0 +1,40 @@ | ||
+<?php | ||
+ | ||
+/* | ||
+ * This file is part of the Postmarkapp\PostmarkBundle | ||
+ * | ||
+ * (c) Miguel Perez <miguel@mlpz.com> | ||
+ * | ||
+ * This source file is subject to the MIT license that is bundled | ||
+ * with this source code in the file LICENSE. | ||
+ */ | ||
+ | ||
+namespace Postmarkapp\PostmarkBundle\DependencyInjection; | ||
+ | ||
+use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
+use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
+ | ||
+/** | ||
+ * Dependency injection configuration | ||
+ * | ||
+ * @author Miguel Perez <miguel@mlpz.com> | ||
+ */ | ||
+class Configuration implements ConfigurationInterface | ||
+{ | ||
+ | ||
+ public function getConfigTreeBuilder() | ||
+ { | ||
+ $treeBuilder = new TreeBuilder(); | ||
+ $rootNode = $treeBuilder->root('postmarkapp_postmark'); | ||
+ | ||
+ $rootNode | ||
+ ->children() | ||
+ ->scalarNode('apikey')->isRequired()->cannotBeEmpty()->end() | ||
+ ->scalarNode('from_address')->isRequired()->cannotBeEmpty()->end() | ||
+ ->scalarNode('from_name')->defaultNull()->end() | ||
+ ->end(); | ||
+ | ||
+ return $treeBuilder; | ||
+ } | ||
+ | ||
+} |
@@ -0,0 +1,61 @@ | ||
+<?php | ||
+ | ||
+/* | ||
+ * This file is part of the Postmarkapp\PostmarkBundle | ||
+ * | ||
+ * (c) Miguel Perez <miguel@mlpz.com> | ||
+ * | ||
+ * This source file is subject to the MIT license that is bundled | ||
+ * with this source code in the file LICENSE. | ||
+ */ | ||
+ | ||
+namespace Postmarkapp\PostmarkBundle\DependencyInjection; | ||
+ | ||
+use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | ||
+use Symfony\Component\Config\FileLocator; | ||
+use Symfony\Component\Config\Definition\Processor; | ||
+use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
+ | ||
+/** | ||
+ * Extension for postmark bundle | ||
+ * | ||
+ * @author Miguel Perez <miguel@mlpz.com> | ||
+ */ | ||
+class PostmarkappPostmarkExtension extends Extension | ||
+{ | ||
+ protected $resources = array( | ||
+ 'postmark' => 'postmark.xml' | ||
+ ); | ||
+ | ||
+ public function load(array $configs, ContainerBuilder $container) | ||
+ { | ||
+ $processor = new Processor(); | ||
+ $configuration = new Configuration(); | ||
+ $config = $processor->processConfiguration($configuration, $configs); | ||
+ | ||
+ $this->loadDefaults($container); | ||
+ | ||
+ if (isset($config['alias'])) { | ||
+ $container->setAlias($config['alias'], 'postmarkapp_postmark'); | ||
+ } | ||
+ | ||
+ foreach (array('apikey', 'from_address', 'from_name') as $attribute) { | ||
+ if (isset($config[$attribute])) { | ||
+ $container->setParameter('postmarkapp_postmark.'.$attribute, $config[$attribute]); | ||
+ } | ||
+ } | ||
+ } | ||
+ | ||
+ /** | ||
+ * @codeCoverageIgnore | ||
+ */ | ||
+ protected function loadDefaults($container) | ||
+ { | ||
+ $loader = new XmlFileLoader($container, new FileLocator(array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config'))); | ||
+ | ||
+ foreach ($this->resources as $resource) { | ||
+ $loader->load($resource); | ||
+ } | ||
+ } | ||
+} |
@@ -0,0 +1,8 @@ | ||
+<?php | ||
+ | ||
+interface Mail_Postmark_Adapter_Interface | ||
+{ | ||
+ public static function getApiKey(); | ||
+ public static function setupDefaults(Mail_Postmark &$mail); | ||
+ public static function log($logData); | ||
+} |
@@ -0,0 +1,61 @@ | ||
+Postmark PHP class changelog | ||
+============================ | ||
+ | ||
+## 0.4.5 | ||
+ | ||
+* Internally uses constants for recipients | ||
+* Trim recipient addresses | ||
+ | ||
+## 0.4.4 | ||
+ | ||
+* Quote address display names to support commas, etc: "Smith, Jane" <jane@smith.com> | ||
+* Added section "Getting started" and "E-mail address validation" to readme | ||
+ | ||
+## 0.4.3 | ||
+ | ||
+* Fixed debug mode checking and added two test cases. Thanks John Beales (jbeales) | ||
+ | ||
+## 0.4.2 | ||
+ | ||
+* Fixed PHPDOC comments | ||
+ | ||
+## 0.4.1 | ||
+ | ||
+* Fixed a bug where sending errors would not show if debug mode was enabled | ||
+* Fixed certificate validation | ||
+ | ||
+## 0.4 | ||
+ | ||
+* SSL with validation against certificate | ||
+* Multiple To | ||
+* Validates all To, Cc and Bcc addresses | ||
+* Custom headers | ||
+* Fixed DEBUG_RETURN bug, thanks hdeshev | ||
+* Improved error handling | ||
+* Check if subject is set | ||
+* Configuration adapter | ||
+* Attachments | ||
+* Unit tests | ||
+ | ||
+## 0.3 | ||
+ | ||
+* Added tag method to handle the Tag header (Jeff Downie - jeff@iwork.ca) | ||
+* Switched fully to markdown for docs | ||
+ | ||
+## 0.2 | ||
+ | ||
+* Added method fromName() to easily override From name | ||
+* Added replyTo method to handle the Reply-To header | ||
+* Added debug modes | ||
+* Improved error handling with address validation etc | ||
+* Fixed comments | ||
+ | ||
+ | ||
+## 0.1.1 | ||
+ | ||
+* Minor and mayor bug fixes. | ||
+ | ||
+ | ||
+## 0.1 | ||
+ | ||
+* Initial |

Oops, something went wrong.
0 comments on commit
5743af2