<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Mail_Transport_File instead of sending anything just saves all outgoing emails in .eml files (those that you can open with many e-mail programs) using filesystem in a directory you specify.
This way Zend_Mail_Transport_File covers all possible e-mail related things that you regularly need to test in a development environment. (name of the component is discussible, probably Zend_Mail_Transport_Debug would fit better)Zend Framework: Zend_Mail_Transport_File Component Proposal
Proposed Component Name
Zend_Mail_Transport_File
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Mail_Transport_File
Proposers
Alexander Steshenko
Zend Liaison
TBD
Revision
1.0 - 1 January 2008: Initial Draft. (wiki revision: 3)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
WILL save outgoing email in the file system
WILL provide some standard way(s) to generate file names
WILL let users to use their own algorithms for generating file names
WILL allow configuration through Zend_Application_Resource_Mail options
WILL NOT really send an e-mail message
4. Dependencies on Other Framework Components
- Zend_Mime
- Zend_Mail_Transport_Abstract
- Zend_Mail_Transport_Exception
- Zend_Filter_Interface (for custom algorithms of generating file names)
5. Theory of Operation
// still writing this one
6. Milestones / Tasks
- Milestone 1: Complete theory of operation
- Milestone 2: Discuss with the community ways of a file name generation. Define which should be implemented in the component.
- Milestone 3: Define what should happen if a file exists already. (Options are: an exception thrown or changing the name automatically)
- Milestone 4: Define if some additional features are required (using feedback).
- Milestone 5: Complete unit tests
- Milestone 6: Documentation
7. Class Index
- Zend_Mail_Transport_File
8. Use Cases
| UC-01: Configuring the transport using Zend_Application_Resource_Mail |
|---|
This is how a configuration may be done. A good setup for testing different aspects of email messagin in development environment may be setup just by editing the main configuration file, no other changes are necessary:
| UC-02: Using a custom filter to generate file names |
|---|
Using a filter implementing Zend_Filter_Instance you can define your own rules how should a name for a file be generated.
in the configuration you may add filter option
[development]
; This options for the dev env:
resources.mail.transport.type = file
resources.mail.transport.path = "/tmp/send"
resources.mail.transport.filter = "MyLib_MailToFilter"
it will be automatically loaded and added to the transport, so, when you send an email to the smith@example.com, a file like /tmp/send/smith@example.com_18-00-12.eml will appear with the email content.
9. Class Skeletons
The class Zend_Mail_Transport_File is pretty much simple and is here you can see fully implemented idea even though it may be changed during the discussion and according to the feedback.