Remove list name from the browser tab

You can try with this code in apps/init-custom.php (create the file if missing):
PHP:
<?php
    
hooks()->addAction('frontend_controller_lists_before_render', function() {
    if (controller()->getAction()->getId() === 'unsubscribe') {
        controller()->setData([
            'pageMetaTitle' => 'Your title',
        ]);   
    }
});
 
thank you

it works with this tag [UNSUBSCRIBE_LINK]


but it doesn't work with this tag [DIRECT_UNSUBSCRIBE_LINK]

do you know how to make it work in the other tag also?
 
As long as you end up on the unsubscribe page, that code will work. If you land on a different page, it won't work.
 
thank you

it works with this tag [UNSUBSCRIBE_LINK]


but it doesn't work with this tag [DIRECT_UNSUBSCRIBE_LINK]

do you know how to make it work in the other tag also?

You need to add and unsubscribe_confirm because direct unsubscribe link redirect to another page.

PHP:
hooks()->addAction('frontend_controller_lists_before_render', function () {
    if (controller()->getAction()->getId() === 'unsubscribe' || controller()->getAction()->getId() === 'unsubscribe_confirm') {
        controller()->setData([
            'pageMetaTitle' => 'Your title',
        ]);
    }
});
 
You need to add and unsubscribe_confirm because direct unsubscribe link redirect to another page.

PHP:
hooks()->addAction('frontend_controller_lists_before_render', function () {
    if (controller()->getAction()->getId() === 'unsubscribe' || controller()->getAction()->getId() === 'unsubscribe_confirm') {
        controller()->setData([
            'pageMetaTitle' => 'Your title',
        ]);
    }
});
Thank you so much, it worked
 
Back
Top