Skip to end of metadata
Go to start of metadata

Zend Framework: Zend_Mail_Transport_Queue Component Proposal

Proposed Component Name Zend_Mail_Transport_Queue
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Mail_Transport_Queue
Proposers
Revision 0.1 - 1 October 2007: Initial proposal. (wiki revision: 3)

Table of Contents

1. Overview

Zend_Mail_Transport_Queue is designed to manage the delivery of a large volume of mail. It provides a number of backends by which to store the mail and then allows deferred delivery from the storage container using concrete transport methods from a separate script.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will provide an interface to allow the creation of multiple backends.
  • This component will not send mail after a developer-specified amount of retries.
  • This component will allow the developer to pass any valid transport component to re-send mail.
  • This component will provide a means for passing log instances.

4. Dependencies on Other Framework Components

  • Zend_Mail
  • Zend_Mail_Transport_Abstract

5. Theory of Operation

This transport type replaces an existing SMTP or Sendmail transport instance. A concrete storage adapter is instantiated (e.g. Zend_Mail_Transport_Queue_Db or Zend_Mail_Transport_Queue_File) and then used as the transport to dispatch mail in the usual manner.

A secondary script (run as a cron job, scheduled task or as a trigger during another script's execution) will then access the transport's static process method. During this time mail is processed and directed to a specified transport (e.g. SMTP or Sendmail) and sent as normal. Processing will be limited to an amount configurable by the developer. If a mail instance cannot be sent (i.e. throws a Zend_Mail_Transport_Exception or Zend_Mail_Protocol_Exception exception) the mail will be requeued for a specified amount of retries (default is 10).

When mail is processed (success or failure) Zend_Mail_Transport_Queue will also log the attempt if a Zend_Log adapter is made available. The content and format of the log message is also developer-configurable.

6. Milestones / Tasks

  • Milestone 1: design notes will be published here
  • Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
  • Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
  • Milestone 4: Unit tests exist, work, and are checked into SVN.
  • Milestone 5: Initial documentation exists.

7. Class Index

  • Zend_Mail_Transport_Queue_Interface
  • Zend_Mail_Transport_Queue_Abstract
  • Zend_Mail_Transport_Queue_Db
  • Zend_Mail_Transport_Queue_File

8. Use Cases

9. Class Skeletons

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 02, 2008

    Zend Comments
    This proposal has been accepted for development in the standard incubator as-is.
  2. Oct 14, 2008

    Very nice! Exactly the thing i was searching for. Will it be provided with ZF 1.7?
    Kind regards, Dennis.

  3. Oct 26, 2008

    Great idea!

    Perhaps this should be a subclass to a Zend_Queue class, or simply a Zend_Queue where this functionality easily can be achieved.

    Queues could probably be useful for other things such as file manipulation, PDF creation, and others.

    Just a thought.

  4. Jan 25, 2009

    Wow... A few weeks ago I tried to realize the same thing as this component will do.

    Is there already working code in svn? Could not find it.

  5. Feb 25, 2009

    That is really great!!!
    Probably only thing that is missing is to implement a mail priority feature in the queue.
    IMHO, there should be a feature that will allow more important mails to be send firstly in a large queues.

  6. Mar 18, 2009

    This proposal hasn't been worked on in the last 6 months. Archiving for now.