Closed (fixed)
Project:
Devel
Version:
8.x-1.x-dev
Component:
devel
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Nov 2009 at 06:43 UTC
Updated:
14 Aug 2011 at 14:33 UTC
Jump to comment: Most recent file
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 ;(
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | develmail-625062-1.patch | 4.48 KB | JacobSingh |
Comments
Comment #1
JacobSingh commentedHeh, added some more keywords to the header, and attached the patch.
Comment #2
gregglesComment #3
rfayIt was my impression that Moshe was not going to put mail stuff in devel any more. Maybe this should be in its own module?
Comment #4
JacobSingh commentedbump!
Comment #5
kbahey commentedWould something like http://drupal.org/project/reroute_email do the trick?
Comment #6
JacobSingh commentedd'oh!
Well, I guess we can decide what to do now. I didn't realize there was a separate module for this same thing. Devel used to do it, I figured it still should.
This is D7 compat, but was written a month or so ago, so who knows now. Also, I wrote a test.
I'm fine ditching the code, but what about merging reroute_email into devel? It seems like a fairly lightweight module that doesn't really have many standalone applications.
What do devel maintainers think?
IF we go the other way, is any of this code re-usable in reroute_email?
Best,
Jacob
Comment #7
moshe weitzman commentedThe use cases for rerouting email are far beyond just developers. I'd like to keep the modules separate.
Comment #8
moshe weitzman commentedReassigning to reroute email project. Hopefully it can use the test code here, at least.
Comment #9
moshe weitzman commentedI needed this functionality and all the other modules that do similar stuff have a release status of 7.x-1.x-alpha-beta-at-the-beach. so, back into devel it goes.
committed to 8.x and 7.x with some minor modernizing. thanks for the patch and sorry for the delay.
turn it on with this code in settings.php
Comment #10
rfayHmm. Reroute Email has been in fine shape for a very long time. I guess time to ask kbahey to make a release.
Comment #11
rfayRelease requested in #1197818: Please create 7.x stable release
Comment #12
robertom commentedthanks, this is very useful
Comment #14
matt bI've installed the devel module (both 7.x-1.2 and the dev version) and updated the settings.php file. when I send a mail via the contact form I get a "Your message has been sent." message, but I cannot find a 'mail' folder in either the private or public files directory with the mails in.
Comment #15
moshe weitzman commentedAs stated at top of devel.mail.inc, we log to the temp directory that is configured for drupal. that one is rarely exposed to the web so no sensitive info is likely to leak.
Comment #16
matt bThanks - I can see the mails there - this is a really useful tool!
Comment #17
rfayI should mention, @moshe weitzman, that reroute_email now has a release :-) No changes, but does have an official release.