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

Avoid sending emails when IMS file is NOT new (IMS Enterprise file enrolments)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 1.6, 1.7, 1.8, 1.9
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Add condicional before sending to Admin IMS log. Only send mail, if IMS file is new.

      STABLE BRANCH:
      line 382:
      if ( $fileisnew ) {
      email_to_user(get_admin(), get_admin(), "Moodle IMS Enterprise enrolment notification", $msg);
      $this->log_line('Notification email sent to administrator.');
      }

      MAIN BRANCH:
      if ( $fileisnew ) {
      $eventdata = new object();
      $eventdata->modulename = 'moodle';
      $eventdata->userfrom = get_admin();
      $eventdata->userto = get_admin();
      $eventdata->subject = "Moodle IMS Enterprise enrolment notification";
      $eventdata->fullmessage = $msg;
      $eventdata->fullmessageformat = FORMAT_PLAIN;
      $eventdata->fullmessagehtml = '';
      $eventdata->smallmessage = '';
      events_trigger('message_send', $eventdata);
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              tmas Toni Mas
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: