7.11.18 Campaign email - "opt in" record at bottom

How to remove ‘To remove yourself from this email list click here’ from bottom of campaign emails? I offer recipients the option to expressly opt out in their replies and keep track of opted-out recipients through a custom field.
In EMAIL OPTIONS I have set ‘Opt In Settings’ to ‘Disabled’ and ‘Confirm Opt In Email Template’ to ‘None’ but the message persists.
The ‘Remove opt-out link on email campaign’ community post topic seems similar, but the reply just passes judgement on its advisability rather than actually providing the answer. I’ve also read the topic ‘Opt-in and Confirmed Opt-in simultanously in use after GDPR’ and the ‘Confirmed Op In’ doc on the combinations of settings, but can’t determine how to remove it (for now). Please advise, thanks.
Thanks.

It is possible to remove such a link but not quite simple neither upgrade safe.
The easiest approach, or less complex one, is to edit the core file modules/EmailMan/EmailMan.php around line 1120. You have to remove the respective code.

The hardest approach is to create an extended include inside which you will redefine the BeanName for EmailMan and its php script as well. So inside that custom one you can extend the core one and override the method sendEmail in order to accomplish taht approach.

Kind regards

andopes: I commented out out lines 1119-1121 and seem to have achieved my objective; thanks. Is it true that whichever package I upgrade to next will replace EmailMan.php and I’ll be back where I was? If so, is there an override php file that I can instead use that will remain effective after each upgrade?

If such a file get modified in new upgrades then your change will be lost, so perform a double check after every single upgrade.

Upgrade-safe Customization of EmailMan:

custom/modules/EmailMan/CustomEmailMan.php

<?php
$customBeanList['EmailMan'] = 'CustomEmailMan';
$customObjectList['EmailMan'] = 'CustomEmailMan';
$customBeanFiles['EmailMan'] = 'custom/modules/EmailMan/CustomEmailMan.php';
?>

Check that this :point_up: gets pulled into
custom/application/Ext/Include/modules.ext.php with a QR&R.

Then put your custom class in
custom/modules/EmailMan/CustomEmailMan.php

<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}

require_once 'modules/EmailMan/EmailMan.php';

class CustomEmailMan extends EmailMan {

    public function sendEmail(SugarPHPMailer $mail, $save_emails = 1) {
         ...  [override code here, perhaps call parent function] ...
   }
}

The above is an example overriding the sendEmail function, but you can do it for any member function.