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

New message_send API is incapable of sending notfications from the $CFG->noreplyaddress.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.6
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      Test self enrol welcome msg.

      1. Create a course with self enrolment
      2. self enrol user in this course
      3. Make sure user get email from $CFG->supportemail (if not set then sent from admin)

      (Set $CFG->forum_replytouser to No)

      Test forum mail

      1. Create a new forum post (select mail now) as teacher and run cron.
      2. Make sure teacher gets a mail from noreply address
      3. Log in as student and reply to post
      4. Make sure teacher and student get mail. Teacher gets a mail from student and student gets a mail from noreply.

      Test Assignment mail

      1. Create assignment and enrol few students
      2. As student submit assignment and make sure student gets an email from themselves.
      3. As teacher give feedback and run cron.
      4. Make sure student gets an email about feedback from teacher email.

      Test Quiz mail

      1. Create a quiz with few question
      2. Give "mod/quiz:emailconfirmsubmission" to student.
      3. Attempt quiz and make sure student gets a notification about submission and mail is from Admin user. (As this is hard-coded to use admin for now)

      Test error email

      1. Log in as admin
      2. Go to MOODLE_SITE/error
      3. Send msg and make sure msg is sent to $CFG->supportemail (if not set then sent to admin)
      Change config
      1. Change $CFG->noreplyuserid to some userid and make sure noreply msg is from that user
      2. Change $CFG->supportuserid to some userid and make sure support msg is sent to that user email.
      Change msg config on site level
      1. Change site level msg config to force msg's to email
      2. Make sure above test works.
      Show
      Test self enrol welcome msg. Create a course with self enrolment self enrol user in this course Make sure user get email from $CFG->supportemail (if not set then sent from admin) (Set $CFG->forum_replytouser to No) Test forum mail Create a new forum post (select mail now) as teacher and run cron. Make sure teacher gets a mail from noreply address Log in as student and reply to post Make sure teacher and student get mail. Teacher gets a mail from student and student gets a mail from noreply. Test Assignment mail Create assignment and enrol few students As student submit assignment and make sure student gets an email from themselves. As teacher give feedback and run cron. Make sure student gets an email about feedback from teacher email. Test Quiz mail Create a quiz with few question Give "mod/quiz:emailconfirmsubmission" to student. Attempt quiz and make sure student gets a notification about submission and mail is from Admin user. (As this is hard-coded to use admin for now) Test error email Log in as admin Go to MOODLE_SITE/error Send msg and make sure msg is sent to $CFG->supportemail (if not set then sent to admin) Change config Change $CFG->noreplyuserid to some userid and make sure noreply msg is from that user Change $CFG->supportuserid to some userid and make sure support msg is sent to that user email. Change msg config on site level Change site level msg config to force msg's to email Make sure above test works.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      wip-mdl-31560
    • Story Points:
      8
    • Sprint:
      BACKEND Sprint 4

      Description

      The old email_to_user API could do this, and we need to be able to do this in many places in the code that currently use email_to_user, and which should be updated to message_send in future.

      Please extend the API to make this possible. The old system was able to set a fake name to go beside the $CFG->noreplyaddress, so for example you might get emails from

      • Shy User <noreply@moodle.org> - for example when a forum poster has decided they want to keep their email private; or
      • Quiz system <noreply@moodle.org> - for emails generated in code.

      I think both these use-cases are important, and so need to be implemented in the API, but from what I can see, this will be hard because:

      • messages can hang around for some time in the message_working table - that is, there is no guarantee that messages are sent synchronously - it is up to the message output plugins.
      • The from address in the message table is stored as a userid in a NOT NULL DEFAULT 0 column.

      Note that this issue is different from MDL-6796.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13