dstegelman/django-mail-queue — pull request #16 by rspeed (2013-02-22 18:37:02+00:00)
Title: Added ability to delete sent messages

Does what it says on the tin. I added a method called ``clear_sent_messages`` to the model manager which deletes any messages where ``sent`` is True. You can also configure it to only delete the records after a certain period of time. It can be configured using ``MAILQUEUE_CLEAR_OFFSET``. If the offset is an integer it gets treated as a number of hours, but it also accepts a ``datetime.timedelta`` object. By default it's 0, so any sent email will be deleted as soon as the task runs.

It can be run either through a management command (which accepts an ``offset`` option), a view (which maps to ``mail-queue/clear``), or a Celery task. There are some additional changes I want to make, including documentation and adding the ability to specify an offset with the Celery task.