Fake Mail Library for sending / logging mails to a text file to debug

JacobSingh - November 6, 2009 - 06:43
Project:Devel
Version:7.x-1.x-dev
Component:devel
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I've created a D7 implementation of the SMTP stuff for Devel.

It still probably needs a little love in the documentation department, but here's the deal:

variable_set('mail_system', array('default-system', 'DevelMailLog'));

Enables it. Unless you set anything else mails are saved to files/mails/$to-$subject-$datetime.mail.txt

You can change the directory with

variable_set('devel_debug_mail_directory', file_directory_path() . '/mails');

Or the file format

variable_set('devel_debug_mail_file_format', '%to-%subject-%datetime.mail.txt');

Currently, only those three tokens are supported, and NOT through token module.

I also added a test which is *almost* a pure unit test, but because of the variable_get's couldn't use the DrupalUnitTest base class ;(

#1

JacobSingh - November 6, 2009 - 06:50
Title:Fake Mail Library for sending mails to a text file.» Fake Mail Library for sending / logging mails to a text file to debug

Heh, added some more keywords to the header, and attached the patch.

AttachmentSize
develmail-625062-1.patch 4.48 KB

#2

greggles - November 6, 2009 - 13:35
Status:active» needs review

#3

rfay - November 8, 2009 - 02:20

It was my impression that Moshe was not going to put mail stuff in devel any more. Maybe this should be in its own module?

 
 

Drupal is a registered trademark of Dries Buytaert.