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

Add a constant to the subject of all emails

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Pre requisite

      • Make sure your test system is capable of sending emails (set up a local mailhog, mailcatcher, etc to catch them)

      Test to confirm backwards compatibility

      Fire off a simple test email from the cli:

      php -r "define('CLI_SCRIPT', true); require_once('config.php'); email_to_user((object)['id'=>1,'email' => 'user@example.com'], core_user::get_support_user(), 'subject1', 'body');"

      • See that you get the email as expected with just 'subject1'

      Test to confirm the desired behavior

      • Set admin config 'emailsubjectprefix' to something like "[ACME Corp]"

      Fire off another simple test email from the cli:

      php -r "define('CLI_SCRIPT', true); require_once('config.php'); email_to_user((object)['id'=>1,'email' => 'user@example.com'], core_user::get_support_user(), 'subject2', 'body');"

      • See that you get the email with the constant prepended to the subject, i.e. "[ACME Corp] subject2"
      Show
      Pre requisite Make sure your test system is capable of sending emails (set up a local mailhog, mailcatcher, etc to catch them) Test to confirm backwards compatibility Fire off a simple test email from the cli: php -r "define('CLI_SCRIPT', true); require_once('config.php'); email_to_user((object)['id'=>1,'email' => 'user@example.com'], core_user::get_support_user(), 'subject1', 'body');" See that you get the email as expected with just 'subject1' Test to confirm the desired   behavior Set admin config 'emailsubjectprefix' to something like " [ACME Corp] " Fire off another simple test email from the cli: php -r "define('CLI_SCRIPT', true); require_once('config.php'); email_to_user((object)['id'=>1,'email' => 'user@example.com'], core_user::get_support_user(), 'subject2', 'body');" See that you get the email with the constant prepended to the subject, i.e. " [ACME Corp] subject2"
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-63569-email-header-master

      Description

      We have a number of government clients who find that emails with a subject containing the string "[SEC=UNCLASSIFIED]" are more likely to get through their mail servers.

      We'd like the ability to add a constant to the subject of all emails sent by Moodle to accomplish this.

      For example, given a constant of "[SEC=UNCLASSIFIED]", and an email where the subject would have previously been "Welcome to Moodle", the email would be sent with a subject of "[SEC=UNCLASSIFIED] Welcome to Moodle".

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 5 minutes
                  1h 5m