Subscription Preferences > Unsubscribe label customization

The client wants to have custom text on the unsubscribe label in the subscription preference page as something below like this,

<span>Unsubscribe me from all mailing lists.</span><br><span class="class-name"> No more calls, no more texts - we're breaking up.</span>

It was working with style hack previously. Now it is breaking the button code.

Any help, please…

Hi @miteshpatel,

by default it should be possible to paste your code directly into the label field - but since it’s breaking your code. Have you tried/thought about a small .replaceWith() script?

Something like this:

$( ".subscribe-options label.globalunsub p span" ).replaceWith( "<span>Unsubscribe me from all mailing lists.</span><br><span class="class-name"> No more calls, no more texts - we're breaking up.</span>" );

best,

Anton

@Anton Sorry for the confusion, I should have to be more specific.

Actually, the client wants to customize the button text for the unsubscribe-all page which is user-specific when someone clicks on unsubscribe link from the email footer (CAN-SPAM token) which redirects the user to the unsubscribe page (Screenshot by Lightshot).

So instead of the “Unsubscribe me from all mailing lists” button, the customer wants a specific custom button text that I have written in my previous message.

Hope this would clear the matter and I will get the exact solution if you have any knowledge regarding that.

Thanks!

You can use text() to change just the text.

<script>
 $( window ).on( "load", function() {
 $('label[for="globalunsub"] span').text("Your custom text here");
 });
</script>

If the text is different per user I’d create a contact property to add that text to and then use that property to determine what text to change it to.

<script>
 $( window ).on( "load", function() {
 $('label[for="globalunsub"] span').text("{{ contact.property_name }}");
 });
</script>