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
Heh, added some more keywords to the header, and attached the patch.
#2
#3
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?