Additional string interpolation for Plone: add content text in your contentrule e-mail messages
Project description
This is a Plone extension for the plone.stringinterp module.
Adding this to your buildout and you will be able to add full content text in content rules e-mail messages.
How to use
When you are preparing e-mail action for your Plone Content Rules you can now use two additional marker in the text:
- ${text}
The current document full text
- ${indented_text}
Same as above, but right-indent the text using a tab char before every line.
Text is transformed from HTML to plain text (as ussualy are Plone e-mail).
A mail message rule configured like this:
Hi, the new document "${title}" has been created. ${text}
…will generate this:
Hi, the new document "Welcome to Plone" has been created. If you're seeing this instead of the web site you were expecting...
And a mail message rule configured like this:
Hi, the new document "${title}" has been created. ${indented_text}
…will generate this:
Hi, the new document "Welcome to Plone" has been created. If you're seeing this instead of the web site you were expecting...
Getting text
“Main text field” is an abstract entity. This product try to guess text using adapters, so you can override or provide more specific ones (see the code some example).
Generally, those kind of text extraction is supported:
ATContentTypes based content types with a text field (Event, News Item, Document, Topic)
Comment from plone.app.discussion
Dexterity content types with a text field
Plus, a general adapter that simply try to read if a “text” attribute is provided.
Credits
Developed with the support of Regione Emilia Romagna; Regione Emilia Romagna supports the PloneGov initiative.
Changelog
0.1 (2013-05-30)
Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for collective.stringinterp.text-0.1.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3816efb5ba070b69439653f9643f11f88a23475d430313563bab95adca65d96d |
|
MD5 | b313ea8b1b86260c31fce14abbe416bb |
|
BLAKE2b-256 | 4c9c6d9272b17498d8bc7910c2c7935e6112fc5e464979329bf4b2f9a44aa0d5 |