Hi all
I am trying to change the opt_out settings for a contact record
I have tried
$bean->email_address->opt_out = (bool) $opt_out;
$bean->email_address->save()
$bean->email_address->opt_out = (int) $opt_out;
$bean->email_address->save()
$bean->email_address->opt_out = (bool) $opt_out;
$bean->email_address->save($bean->id, $bean->module_name)
$bean->email_address->opt_out = (int) $opt_out;
$bean->email_address->save($bean->id, $bean->module_name)
$bean->email_opt_out = (bool) $opt_out;
$bean->save()
$bean->email_opt_out = (int) $opt_out;
$bean->save()
none of the above seem to change the opt_out settings on the record
I had a look for some clues in the SugarEmailAddress class and the closest thing I could find was addUpdateEmailAddress but this does not seem to be what I am looking for.
How does the CRM system do this normally?