View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}
{zone-data:component-name}
Zend_Application_Resource_Smtp
{zone-data}
{zone-data:proposer-list}
[Justin Hendrickson|mailto:justin.hendrickson+zend@gmail.com]
{zone-data}
{zone-data:liaison}
TBD
{zone-data}
{zone-data:revision}
1.0 - 1 January 2008: Initial Draft.
{zone-data}
{zone-data:overview}
Zend_Application_Resource_Emailtransport is a resource class for creating concrete Zend_Mail_Transport_Abstract instances.
{zone-data}
{zone-data:references}
* [Zend_Application|http://framework.zend.com/manual/en/zend.application.html]
* [Zend_Mail|http://framework.zend.com/manual/en/zend.mail.html]
{zone-data}
{zone-data:requirements}
* This component *will* include a factory resource that delegates creating the email transport to a concrete resource implementation.
* This component *will* include concrete implementations for existing transports.
{zone-data}
{zone-data:dependencies}
* Zend_Application_Resource_ResourceAbstract
* Zend_Mail
* Zend_Mail_Transport_Sendmail
* Zend_Mail_Transport_Smtp
{zone-data}
{zone-data:operation}
The component will implement the ResourceAbstract interface. It will allow setting of the adapter to be used and arbitrary options that will be passed onto a concrete email transport resource on initialization.
{zone-data}
{zone-data:milestones}
* Milestone 1: [design notes will be published here|http://framework.zend.com/wiki/x/sg]
* Milestone 2: Working prototype checked into the incubator supporting use case #1
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.
{zone-data}
{zone-data:class-list}
* Zend_Application_Resource_Emailtransport
* Zend_Application_Resource_Emailtransport_Sendmail
* Zend_Application_Resource_Emailtransport_Smtp
{zone-data}
{zone-data:use-cases}
||UC-01||
Basic sendmail setup
{code}
$resource = new Zend_Application_Resource_Emailtransport(array(
"adapter" => "sendmail",
"parameters" => "-fme@example.com"
));
$resource->init();
{code}
||UC-02||
SMTP with authentication over SSL and setting the transport as default
{code}
$resource = new Zend_Application_Resource_Emailtransport(array(
"adapter" => "smtp",
"auth" => "plain",
"defaultTransport" => true,
"host" => "smtp.example.com",
"password" => "my-password-here",
"ssl" => "ssl",
"username" => "my-username-here"
));
$resource->init();
{code}
||UC-03||
Custom Emailtransport adapter
{code}
$resource = new Zend_Application_Resource_Emailtransport(array(
"adapter" => "custom",
"prefixPaths" => array(
"My_Email_Transport_" => "path/to/My/Email/Transport/"
)
));
$resource->init();
{code}
{zone-data}
{zone-data:skeletons}
{code}
class Zend_Application_Resource_Emailtransport extends Zend_Application_Resource_ResourceAbstract
{

/**
* Get the plugin loader
*
* @return Zend_Loader_PluginLoader
*/
public function getPluginLoader()
{
}

/**
* Initialize the transport
*
* @return Zend_Mail_Transport_Abstract
*/
public function init()
{
}

/**
* Set the adapter name
*
* @param string $adapter
* @return Zend_Application_Resource_Emailtransport
*/
public function setAdapter($adapter)
{
}

/**
* Set the prefix paths
*
* @param array $prefixPaths
*/
public function setPrefixPaths($prefixPaths)
{
}

}

class Zend_Application_Resource_Emailtransport_Sendmail extends Zend_Application_Resource_ResourceAbstract
{

/**
* Initialize the sendmail transport
*
* @return Zend_Mail_Transport_Sendmail
*/
public function init()
{
}

/**
* Set the transport as the Zend_Mail default
*
* @param boolean $defaultTransport
* @return Zend_Application_Resource_Emailtransport_Smtp
*/
public function setDefaultTransport($defaultTransport)
{
}

/**
* Set the sendmail parameters
*
* @param string $parameters
* @return Zend_Application_Resource_Emailtransport_Sendmail
*/
public function setParameters($parameters)
{
}

}

class Zend_Application_Resource_Emailtransport_Smtp extends Zend_Application_Resource_ResourceAbstract
{

/**
* Initialize the Smtp transport
*
* @return Zend_Mail_Transport_Smtp
*/
public function init()
{
}

/**
* Set the transport as the Zend_Mail default
*
* @param boolean $defaultTransport
* @return Zend_Application_Resource_Emailtransport_Smtp
*/
public function setDefaultTransport($defaultTransport)
{
}

/**
* Set the host name
*
* @param string $host
* @return Zend_Application_Resource_Emailtransport_Smtp
*/
public function setHost($host)
{
}

}
{code}
{zone-data}
{zone-template-instance}]]></ac:plain-text-body></ac:macro>