Non-core contributed modules

Email alerts are not being sent to users external email addresses

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.7, 1.8, 1.9
  • Component/s: Block: Email_list
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Copied from this discussion - http://moodle.org/mod/forum/discuss.php?d=106627:

"The option for send notified mail to users doesn't work with the version 1.4.
The reason is the following line of block_email_list.php script:

if ( $preferences->trackbymail === 1 and $CFG->email_trackbymail == 1 ) {

The function var_dump show that " $preferences->trackbymail" is string(1) type. So, the condition is false and the warnings to the user's email address are not send."

I've verified that changing the above line to the following results in correct email alerts when the preference is set -

if ( $preferences->trackbymail == 1 and $CFG->email_trackbymail == 1 ) {

Activity

Hide
Toni Mas added a comment -

Hi Ann,

I'm applies this other solution:

// If NOT enabled
if ( $CFG->email_trackbymail == 0 ) { return true; }

// User can definied this preferences?
if ( $preferences = get_record('email_preference', 'userid', $user->id) ) {
if ( $preferences->trackbymail == 0 ) { continue; }
}

See this code in this environment (http://cvs.moodle.org/contrib/plugins/blocks/email_list/block_email_list.php?revision=1.15&view=markup)

Thanks for your hard work,
Toni

Show
Toni Mas added a comment - Hi Ann, I'm applies this other solution: // If NOT enabled if ( $CFG->email_trackbymail == 0 ) { return true; } // User can definied this preferences? if ( $preferences = get_record('email_preference', 'userid', $user->id) ) { if ( $preferences->trackbymail == 0 ) { continue; } } See this code in this environment (http://cvs.moodle.org/contrib/plugins/blocks/email_list/block_email_list.php?revision=1.15&view=markup) Thanks for your hard work, Toni

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: