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

Admins should be notifed about Portfolio problems using new messaging events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Portfolio
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Hi Penny

      For notifying admins, you can do it something like this:

      function portfolio_notify_admins($subject,$a) {

      $admins = get_admins();

      $body = get_string('something','portfolio',$a);

      foreach ($admins as $admin)

      { $eventdata = new object(); $eventdata->modulename = 'portfolio'; $eventdata->name = 'notices'; $eventdata->userfrom = $admin; $eventdata->userto = $admin; $eventdata->subject = $subject; $eventdata->fullmessage = $body; // plain text message $eventdata->fullmessageformat = FORMAT_PLAIN; $eventdata->fullmessagehtml = 'complete version with HTML etc'; $eventdata->smallmessage = 'something suitable for IM'; events_trigger('message_send', $eventdata); }

      }

        Attachments

          Activity

            People

            Assignee:
            mjollnir Penny Leach
            Reporter:
            dougiamas Martin Dougiamas
            Tester:
            Martin Dougiamas
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10