Hello Richards, Thanks for reading my question. I'll try to clarify what I do and what I need.
I have a table with a text field. Using a SQLFORM.smartgrid, I use the ckeditor widget to populate this field, in order to get the data presented in a nice format (including for titles, email adresses, and so on). This works fine. Now, I want to generate an email with the content of this text field preserving the format created by the ckeditor widget. I can make and send a mail (including with attachments), *BUT:* When I open my mail, for instance with Firefox Web Browser, *I see the tags *used to format the text such as <p> </p>.* My text is not formated* as expected, and I see a series of special characters around email addresses or any url. I found a way to suppress the tags and special chararcters using BeautifullSoup.BeautifullSoup, but then the result (what I read in Firefox Web Browser) looks like a long word (everything is concatenated, the url links are lost,. Therefore I say this is not acceptable). I couldn't find a solution to get retrieve my formated text in Firefox Web Browser using the gluon Mail function. This is what I need. As I am far from being an IT expert, I guess I missed or misunderstood something. Serge Le mardi 20 juin 2017 21:53:14 UTC+2, Richard a écrit : > > Hello Serge, > > It not clear what you are doing exactly, do you mean you parse text with > BeautifulSoup before input it into the database field? And what is > unacceptable? > > About 1, I think previous question would help understand better the issue. > > About 2, I don't see why it wouldn't work... But as I am not sure what you > try to accomplish, I mean if you strip off tag with beatiful in the first > place why add some tag back when you send the message... > > I am sure we would benefit to see a bit of your code to bettter help you. > > Note that HTML in email is a difficult topic as render engine are much > less homogeneous in email client like outlook, thunderbird than what you > may have from a normal browser. So having the right presentation everywhere > is more difficult to achieve than a regular web page. > > Good Luck > > Richard > > On Tue, Jun 20, 2017 at 12:24 PM, Serge Bourgeois <serge.bo...@gmail.com > <javascript:>> wrote: > >> >> I like web2py for the good balance between simplicity and completeness. >> Most of the time, when I have a question, I can find a response googeling. >> Today not... >> >> I could cope with attachments, but I'm still struggling with rich text >> fields for the email body. Using BeautifulSoup.BeautifulSoup(my_field).text >> removes the tags, but the result is not accceptable. >> >> So, if there is a helper, I could not find it (or not use it properly). >> 1. With Mail().send, how to fill the 'message' parameter from a text >> field (let's say my_field) filled in via the ckeditor widget (which allows >> also to incluse a mail address or a URL). >> 2. After getting a response to this first question, if I want to append >> let's say 2 text fields, I 'm gonna try SPAN(my_first_text_field, BR(), >> my_second_text_field). Will this work? >> >> Thanks in advance for any advice. >> >> -- >> Resources: >> - http://web2py.com >> - http://web2py.com/book (Documentation) >> - http://github.com/web2py/web2py (Source code) >> - https://code.google.com/p/web2py/issues/list (Report Issues) >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to web2py+un...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.