1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Styling for unsubscribe link in Newsletters

Styling for unsubscribe link in Newsletters

2 posts, 0 answered
  1. Dinesh
    Dinesh avatar
    46 posts
    Registered:
    03 Aug 2009
    05 Oct 2009
    Link to this post
    Hi

    I would like to apply styles for the unsubscribe link provided in the newsletter section.
    When I try to insert the link the html code is rendered as:
    [unsubscribe]Unsubscribe now[/unsubscribe].  How can I apply styles for it?


    -Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Oct 2009
    Link to this post
    Hi Dinesh,

    You can add a span around the unsubscribe brackets. Sample code:

    <span style="border: red 1px solid; background-color: blue; width: 100px; color: #ffffff;">[unsubscribe]Unsubscribe now[/unsubscribe]</span> 

    By default when Unsibscribe link is added we call pasteHtml method of RadEditor control. You can add js methods when the Link button is clicked and paste the html. Another option is creating a custom class that derives from NewsletterContent and then override CreateChildControls. Then find the link button control and create a new logic for the link button.

    Sample code:

    ((LinkButton)container.UnsubscribeNow).Attributes.Add ("onclick", string.Format( "pasteCustomHtml('{0}','{1}'); return false;"


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered