Opt-Out Redirect in Campaign-Emails


When an opt-out link is clicked in an email from a campaign, a message is displayed in the browser.
But I would rather have a specific page displayed. Is this possible?

I found this Code, but it doesn’t work for me.

$my_redirect_url = "http://www.mywebpage.com/";
header('HTTP/1.1 301 Moved Permanently');

I use Version 7.11.8.

Regards Roland

I did some research and found a solution with the following code.

$my_redirect_url = "MyURL";
$permanent = true;
header('Location: ' . $my_redirect_url, true, $permanent ? 301 : 302);

This works very well when it is added to the file modules/Campaigns/RemoveMe.php.
But the adjustment is deleted with an update.

Is there a solution that the adjustment remains even with an update?