Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83788

Sending HTML emails out from Plone

Are there examples of sending simple HTML formatted emails (<h1>, <b> and such) out from Plone?

Plain text is well-covered, but there are no HTML email out examples.

Upvotes: 2

Views: 794

Answers (2)

maurits
maurits

Reputation: 2365

Depending on your use case, you could also use collective.watcherlist. This was factored out of Products.Poi, which uses it to allow users to subscribe to updates for an issue. That part may not be interesting for you, but it has code that takes a browserview as basis for sending an email. Hooking a page template up to that browserview is of course simple.

If you cannot use it directly, it may serve as a code example.

Upvotes: 1

Martijn Pieters
Martijn Pieters

Reputation: 1121356

You can adapt any of the many python email module examples. Because HTML email usually means sending multipart/alternative messages, things get a little more complicated.

You basically have to construct an email.Message object and pass that to Mailhost.send.

Upvotes: 3

Related Questions