More in this section
Forums / Developing with Sitefinity / auto mailto in content editor

auto mailto in content editor

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
5 posts, 1 answered
  1. Michael
    Michael avatar
    12 posts
    13 Oct 2008
    13 Apr 2009
    Link to this post
    Is there a way to have the RadEditor control for the generic content module to create auto mailto code for email addresses that are typed into the content area?
  2. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    15 Apr 2009
    Link to this post
    Hi Michael,

    Yes, there is such a way. In order to do this, you should create a custom RadEditor ContentFilter. It should use a regular expression to match all e-mail address, and to add mailto: infront of them.
    Here are the steps:
    1. Map the needed template, in order to change the RadEditor's behavior. We are using embedded templates that could not be changed by default. Please take a look at How to map a view to an external template, in Sitefinity 3.6 if you are new to this.

    2. Add the ContentFilter. You might take a look at these articles:
    I hope this helps.
    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Devin
    Devin avatar
    149 posts
    09 Jun 2009
    17 Sep 2009
    Link to this post
    Hi I followed these steps and used the following code but for some reason nothing happens when I switch between Design and HTML view.  Can you please advise?

    <script type="text/javascript"
        // custom filter for email addresses 
        function OnClientLoad(editor, args) { 
            editor.get_filtersManager().add(new EmailFilter()); 
        EmailFilter = function() { 
            this.set_name("RadEditor filter"); 
            this.set_description("RadEditor filter description"); 
        EmailFilter.prototype = 
                                    getDesignContent: function(content) { 
                                        var newContent = content; 
                                        /*var regExpEmail = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
                                        newContent = newContent.replace(regExpEmail, "<a href='mailto:$1'>$1</a>");
                                        newContent = newContent.toUpperCase(); 
                                        return newContent; 
                                    getHtmlContent: function(content) { 
                                        var newContent = content; 
                                        //Make changes to the content and return it 
                                        newContent = newContent.toUpperCase(); 
                                        return newContent; 
        EmailFilter.registerClass('EmailFilter', Telerik.Web.UI.Editor.Filter); 

  4. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    09 Sep 2007
    17 Sep 2009
    Link to this post
    Hey Devin,

    Just a few random thoughts:

    1.  Ensure that the <telerik:RadEditor> tag has the OnClientLoad property:

    <telerik:radeditor runat="server" ID="RadEditor1" SkinID="DefaultSetOfTools" OnClientLoad="OnClientLoad">  
            <strong><br />&nbsp;Switch to Html mode to run the content filter.<br />&nbsp;You will see that the casing is changed to upper case.</strong> 

    2.  Make sure the External Template is mapped and in place.  Georgi linked the instructions above.

    3.  Make sure the web application gets restarted after the Telerik.Sitefinity.Configuration.ControlsConfig.xml file is put into place or changed.  This file is only processed during Application_Start.  Changes won't be seen until the web application is restarted.

    I'm not sure if any of this helps, but those are my stabs in the dark.   ;)    Best of luck.
  5. Devin
    Devin avatar
    149 posts
    09 Jun 2009
    17 Sep 2009
    Link to this post
    Hi Gabe,
    Thanks for the reply, I forgot to set the OnClientLoad property.
Register for webinar
5 posts, 1 answered