The global opt out feature does not appear to be working. Recipients that have global opt out "selected" are not removed during a Mailout send. They still receive email.

After reviewing the code, it was not clear to me where the feature would have been included.

To get it working I patched the mailout_sendmail function.

Please advise if this functionality exists somewhere else, or review patch for inclusion.

++  // Global Opt-Out is not being observed.  Could not find record of this in issues.
++  $opted_out_addresses = db_query("SELECT email FROM {mailout_list_addresses} WHERE list_id = %d", MAILOUT_GLOBAL_OPTOUT);
  	
  $message_count = 0;
  foreach ($address_list AS $key => $data) {
    
++  // Global Opt-Out is not being observed. Adding catch here. 
++  $not_opted_out = 1;
++	for($i = 0; $i < db_num_rows($opted_out_addresses); $i++){
++		$this_opted_out_address = mysql_result($opted_out_addresses,$i,"email");
++		if ($data['email'] == $this_opted_out_address){
++			$not_opted_out = 0; 
++			break; }
++		}
++	if ($not_opted_out){
  	// Insert db record for each insert
    db_query("INSERT INTO {mailout_message_log} (mlid, email_to, name, html) VALUES (%d, '%s', '%s', %d)", $mlid, $data['email'], $data['name'], $data['html']); 
    $message_count++; 
++   }
  }

Comments

8manj-dupe’s picture

I cannot deploy this patch, terminal is reporting "patch unexpectedly ends in middle of line, patch: **** Only garbage was found in the patch input.

The opt-out is definitely not working and we're using rc2. This module is unfortunately not that operational, we are having more problems than success with this!! Can you please forward the amended version of the mailout_send.inc file you have working so we can try that

sime’s picture

Status: Needs review » Fixed

Doh, that's crappy. Fixed in RC3 coming up.

sime’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.