giving users a selection of email type
I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346530 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346532 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
There are some RegEx solutions for stripping HTML tags from a string. You could have a single email containing the tags, but before you send it, check to see if the user prefers plain and if so, run it through the RegEx. Steve On Thu, Aug 4, 2011 at 3:11 PM, Greg Morphis gmorp...@gmail.com wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346533 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Yeah, you also need to put text before html in order for it to show HTML in Gmail if I recall cfmail cfmailparam type=text This is your plain text /cfmailparam cfmailparam type=html pThis is your html/p /cfmailparam /cfmail In order for On Thu, Aug 4, 2011 at 3:25 PM, Bryan Stevenson br...@electricedgesystems.com wrote: Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346534 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
I looked at that, I want to control the email flow. If they choose to receive text only then I want to send a text only email stripped of html.. I've looked at this http://stackoverflow.com/questions/4550583/whats-the-best-way-to-remove-html-from-a-string but I'm not sure this is the way I want to go so I'm asking you all :) On Thu, Aug 4, 2011 at 2:25 PM, Bryan Stevenson br...@electricedgesystems.com wrote: Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346535 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Here is what I consider a very fine blog post on how to properly use the CFMAIL and it's related tags, including a way to strip html to create nice text portions of the email. http://www.trunkful.com/index.cfm/2010/5/27/How-to-CFMAIL-Properly-and-Keep-the-SPAM-in-the-Can -yes, that was a shameless plug for my blog - but the post is relevant. Wil Genovese Sr. Web Application Developer/ Systems Administrator CF Webtools www.cfwebtools.com wilg...@trunkful.com www.trunkful.com On Aug 4, 2011, at 2:27 PM, Casey Dougall wrote: Yeah, you also need to put text before html in order for it to show HTML in Gmail if I recall cfmail cfmailparam type=text This is your plain text /cfmailparam cfmailparam type=html pThis is your html/p /cfmailparam /cfmail In order for On Thu, Aug 4, 2011 at 3:25 PM, Bryan Stevenson br...@electricedgesystems.com wrote: Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346537 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Maybe I misunderstood the question, but this still seems to require the management of 2 blocks of texts, which I thought is what the original poster was trying to avoid. Using RegEx to strip all HTML markup, only 1 block of text needs to be maintained. Steve On Thu, Aug 4, 2011 at 3:25 PM, Bryan Stevenson br...@electricedgesystems.com wrote: Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346538 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Well OKI'll come in with the unpopular vote thenDON'T STRIP HTML! Here is why. I have always found that the text you are left with will NOT look nice to the person receiving it. So by doing it the way I suggested, you can customize the plain text (like all caps heading instead of a bold underlined one via HTML). So for reasons like that, blindly removing tags just doesn't cut it in my books. my 2 cents Cheers On Thu, 2011-08-04 at 14:28 -0500, Greg Morphis wrote: I looked at that, I want to control the email flow. If they choose to receive text only then I want to send a text only email stripped of html.. I've looked at this http://stackoverflow.com/questions/4550583/whats-the-best-way-to-remove-html-from-a-string but I'm not sure this is the way I want to go so I'm asking you all :) On Thu, Aug 4, 2011 at 2:25 PM, Bryan Stevenson br...@electricedgesystems.com wrote: Why yes there isthey are called multipart e-mailshave a look at CFMAILPART (or something to that effect). It allows you to send one e-mail with both a plain text and HTML portion.then it's up to receiver's mail client to display what the user wants to see ;-0 HTH Cheers On Thu, 2011-08-04 at 14:11 -0500, Greg Morphis wrote: I'm giving users a choice of email type, html or plain. Is there a way of getting around having 2 different emails, one for html content and one stripped of tags? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346540 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
On Thu, Aug 4, 2011 at 10:11 PM, Bryan Stevenson wrote: Well OKI'll come in with the unpopular vote thenDON'T STRIP HTML! I have always found that the text you are left with will NOT look nice to the person receiving it. As always that depends on the quality of the input. If you have properly written HTML and you: - remove everything outside the body; - remove script tags including content; - remove style tags including content; - replace anchors with their href; - remove all tags; - collapse whitespace; - rewrap with a flowed algorithm; the content will look pretty OK. Jochem -- Jochem van Dieten http://jochem.vandieten.net/ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346545 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: giving users a selection of email type
Let's agree to disagree Jochempretty OK is not in my vocabulary.but striving for perfection is ;-) An automated process cannot make the types of changes (which are human judgement calls) I mentioned. No process can say hey that doesn't look right and I think I'll make it all caps for better emphasis.or add whitespacehard wrap a line...and so on ...but each to their ownjust providing the OP with options and reasons why ;-) FYI...this has nothing to do with proper HTML (but I understand what you're talking about). Cheers On Thu, 2011-08-04 at 22:49 +0200, Jochem van Dieten wrote: On Thu, Aug 4, 2011 at 10:11 PM, Bryan Stevenson wrote: Well OKI'll come in with the unpopular vote thenDON'T STRIP HTML! I have always found that the text you are left with will NOT look nice to the person receiving it. As always that depends on the quality of the input. If you have properly written HTML and you: - remove everything outside the body; - remove script tags including content; - remove style tags including content; - replace anchors with their href; - remove all tags; - collapse whitespace; - rewrap with a flowed algorithm; the content will look pretty OK. Jochem -- Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: br...@electricedgesystems.com web: www.electricedgesystems.com Notice: This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. Please consider the environment before printing this e-mail ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346546 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm