ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Tell a Friend email includes visible HTML tags

October 12, 2012 11:16pm

Subscribe [2]
  • #1 / Oct 12, 2012 11:16pm

    onedogmedia

    31 posts

    I have a channel that has a text area description field set to XHTML formatting.  When I include this field in the Tell-a-Friend form as part of the message, the user receives the email and it includes the

     and 
    

    tags that are in the description field as well.  They just show up right along with the message. 

    There is probably some easy setting that I am missing to make sure these tags get turned off, but I just can’t find it. I’d like to keep the XHTML format on this field if I can.

    Thanks for any help!

  • #2 / Oct 15, 2012 2:55pm

    Kevin Smith

    4784 posts

    Hi oliversitedesign,

    Could you share your tell-a-friend form so I can try to reproduce this on my end? Also, have you tried perhaps using an HTML-stripping add-on like TruncHTML?

  • #3 / Oct 30, 2012 10:22am

    onedogmedia

    31 posts

    Really sorry for the delayed response.

    Here’s my tell-a-friend form.  In the docs it says if we leave the Message and To fields open for editing, we are inviting spammers—so I decided to make the message hidden.  It includes the {item_desc} field, which contains the item description.  This field is set to XHTML, but changing it to AutoBr didn’t help.  When the friend receives the email, the description contains <p> and <br> tags.

    {exp:email:tell_a_friend charset="utf-8" allow_html="no" redirect="4" replyto="yes" return="{site_url}shop/product/{url_title}"}
                    
    <label for="from">Your Email: </label>
    
    <input type="text" id="from" name="from" size="40" maxlength="35" value="{logged_in_email}" /></p>
            
    <label for="name">Your Name: </label>
    
    <input type="text" id="name" name="name" size="40" maxlength="35" value="{logged_in_screen_name}" /></p>
            
    <label for="to">Your Friends Email: </label>
    
    <input type="text" id="to" name="to" size="40" maxlength="35" /></p>
            
    <label for="subject">Subject: </label>
    
    <input type="text" id="subject" name="subject" size="40" value="Item for sale" /></p>
            
    <label for="message">Your friend will receive a link to this item and a message about joining our site to be able to view it.</label>
    
    
    <input type="hidden" id="message" name="message" rows="10" cols="40" value="Your friend {logged_in_screen_name} ({logged_in_email}) thought you would be interested to see this item for sale.  Check it out!  You can reply to your friend directly by replying to this message.
             
    {title} - {if sale_price !=""}${sale_price}{if:else}${reg_price}{/if}
    ------------
    
    {item_desc}
    
    ------------
             
            
    Sincerely,
    Your friends at {site_url}" />
            
    
    {if captcha}
    Please enter the word in the image below:
    {captcha}
     <input type="text" name="captcha" value="" maxlength="20" /></p>
    {/if} 
            
    <input name="submit" type='submit' value='Send to a Friend' /></p>
    {/exp:email:tell_a_friend}

    TruncHTML seems like a great alternative to Character Limiter, which is something I’ve been looking for in another area of this site, so I will for sure use that elsewhere. But for this, I’m not sure it will work.  It’s more like I need an HTML stripper, which I can find as an add-on.  Just wanted to make sure there isn’t some setting in EE I’m missing.

    Thank you!

  • #4 / Oct 31, 2012 9:40am

    Kevin Smith

    4784 posts

    Ah, ok. No, I don’t think it’s something you’re missing. EE is looking to send a plain-text email here, and if you include HTML in a plain-text email, it’ll just be sent exactly as it looks without rendering the HTML. Give an HTML stripping plugin a try here and let me know how it goes!

  • #5 / Nov 07, 2012 4:07pm

    onedogmedia

    31 posts

    After much research I ended up using the Pitch No Code stripping plugin, which works great.  Looks like a lot of the HTML strippers have been abandoned or no longer available, but this one worked.

    Thanks for your help!

  • #6 / Nov 07, 2012 4:56pm

    Shane Eckert

    7174 posts

    Hey oliversitedesign,

    I am glad that Kevin was able to help!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases