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

Add a constant to the subject of all emails

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • MDL-63569-email-header-master
    • 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"

      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".

       

            pauldamiani Paul Damiani
            egiles Evan Giles
            Dmitrii Metelkin Dmitrii Metelkin
            Jake Dallimore Jake Dallimore
            Janelle Barcega Janelle Barcega
            Votes:
            3 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.