I always create HTML emails.

I've used 3 different methods over the years.

1. Write the HTML using python string formatting
2. Use the Python Dominate package to build the HTML strings 
- https://github.com/Knio/dominate
3. Use web2py templating 
- 
http://www.web2py.com/books/default/chapter/29/08/emails-and-sms#Using-the-template-system-to-generate-messages

I think the web2py templating is the easiest and most natural way to do it 
for web2py coders.

-Jim


On Tuesday, September 20, 2016 at 7:31:55 AM UTC-5, Anthony wrote:
>
> Hard to say without seeing an example. With Python string formatting, you 
> can used named placeholders and fill them with a dictionary. Alternatively, 
> you could use a web2py template (either stored in a "view" file or simply 
> as a string in your code). If you want to build an HTML email, you could 
> also use web2py's HTML helpers.
>
> Anthony
>
> On Tuesday, September 20, 2016 at 7:39:51 AM UTC-4, Pierre wrote:
>>
>> Hi,
>>
>> Trying to make a task compose email messages including variables........ 
>> I don't see a "natural" way to handle this via string manipulation. Is 
>> there an alternative solution ?
>> what's the preferred/standard form for simple emails:  html, xml, text ?
>>
>>

-- 
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.

Reply via email to