Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51386

Log outgoing mail

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.9.1, 3.0.2
    • None
    • Logging
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MDL-51386-master
    • Hide
      1. Send an email (e.g. via a forum, with "Mail now")
      2. View Site administration ► Reports ► Logs, filtered by:
        • Site logs
        • action=Create
        • edulevel=Other
      3. Confirm that there is an "Email sent" event, with the "to" address, "from" address, and subject line used for the email.
      Show
      Send an email (e.g. via a forum, with "Mail now") View Site administration ► Reports ► Logs, filtered by: Site logs action=Create edulevel=Other Confirm that there is an "Email sent" event, with the "to" address, "from" address, and subject line used for the email.

    Description

      For student and staff support, it is sometimes useful to have a log of emails successfully sent out (at least, handed off to the smtp server without an error).

      E.g. If a student complains they weren't notified of the assignment being graded, the log can be reviewed to see if the email was sent.

      There are three approaches to logging that I can think of, all modifying email_to_user():

      1. Add a new \core\event\email_sent event, to complement \core\event\email_failed in lib/moodlelib.php
        • Seems like the best use of the Moodle APIs.
        • However, built-in reporting tools don't seem easy to query.
        • Would probably be coded to only record the metadata (from/to/subject/date).
      2. BCC all sent emails to an admin email account, via a setting like $CFG->bccmails
        • Creates an archive of the entire email, including the body - which could be good or bad, depending on one's requirements.
        • Requires an email account suitable for high-volume traffic.
      3. Log all sent emails to a log file on the server (my current hack).
        • Not accessible from Moodle interface.
        • Easy to grep if one has CLI access.

      Is this worth including? Which approach would be best?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              balchd Dave Balch
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              28 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

                Created:
                Updated: