Moodle

email_to_user() shows notices when sending email to "incomplete" $user objects

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5
  • Component/s: Libraries
  • Labels:
    None
  • Database:
    Any
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The email_to_user() function is supposed to work with "fake" (not belonging to DB) $user objects . This way, it's enough to have:

$user->email= 'xx@domain.com'

and mail will be sent to that address, no matter of the rest of the missing bits in the $user object.

But right now, two notices about undefined $user->id are present. One in the set_send_count() function and another in the over_bounce_threshold() function.

Going to check for $user->id existence in both functions to prevent those notices.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed. Ciao
Hide
Andrew Davis added a comment -

Closing although it seems a little odd to allow fake users to be sending email.

Show
Andrew Davis added a comment - Closing although it seems a little odd to allow fake users to be sending email.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: