This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

first commit

  • Loading branch information...
miguel250 committed Jun 14, 2011
0 parents commit 5743af2af7f6b93e60daf79dda9f253f1a49a77f
@@ -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

Please sign in to comment.