I have a hard time having the 'write to temporary file directory' mail logger useful. I can't see the results right as I'm executing the mail action in the UI. I propose we add a DevelDebugMailLog which uses dpm() and watchdog() to record the mails. I think this would be incredibly useful for not just myself, so I'm proposing that the HelperDebugMailLog from http://drupal.org/project/helper be merged into devel.

Related:
#1246978: Include mail debug option
#1228590: Mail logging settings and email logging to watchdog

CommentFileSizeAuthor
#1 1978250-devel-debug-mail-log.patch1.94 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
1.94 KB
salvis’s picture

Status: Needs review » Needs work

I like this, thank you! I've done something similar myself, and having it in Devel would make sense.

Are you proposing to add yours to the existing one? The changed documentation comment still mentions only the existing one.

Not sure which one is more "Debug" -- maybe DevelUIMailLog would be a better name?

README.txt needs to be updated, too.

+++ b/devel.mail.inc
@@ -1,21 +1,24 @@
- * MailSystemInterface for logging mails to the filesystem.
+ * Devel-provided MailSystemInterfaces for debugging mails.

They're really MailSystems, not just MailSystemInterfaces.

+++ b/devel.mail.inc
@@ -1,21 +1,24 @@
+ * $conf['mail_system'] = array('default-system' => 'DevelMailLog');

I'd vote for showing the new one here, if not both.

moshe weitzman’s picture

Lets do D8 first.

DevelDebugMailLog should be its own file, like DevelMailLog.php. Also see composeMessage() method from that file. We might borrow parts of that?

Perhaps use config() variable to say if user wants dpm(), watchdog, or both?

pcambra’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
moshe weitzman’s picture

Issue summary: View changes

FYI, D8 core provides a mail system implementation that saves to State. See test_mail_collector

lussoluca’s picture

Status: Needs work » Needs review
Issue tags: +DevDaysMilan

Webprofiler has a datacollector that collects sent email, so maybe we can use it in combination with DevelMailLog to provide an easy way to explore email data.

moshe weitzman’s picture

Status: Needs review » Fixed

This got done \Drupal\devel\Plugin\Mail\DevelMailLog

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.