Dependencies
mailtoplone.base:
Scrawl:
Example buildout
buildout:
Change history
Changelog
0.2 (2009-05-10)
fix issue querying multidapter with None, now correctly use context.REQUEST [ramonski]
0.1 (2009-05-29)
call add_category [hplocher]
get all attachments from mail, and call add_file for each [hplocher] call add_file for each, before calling create
decode subject header, used as title [hplocher]
refactor adapter, use IBlogEntryFactory [hplocher]
add adapter to create a Blog Entry [hplocher] (title, body text, only atm)
Detailed Documentation
Introduction
We need manager role for this test:
>>> self.setRoles(('Manager',))
Configure Folder for Blog Entries
We use a standard Folder for dropping the emails in:
>>> self.portal.invokeFactory('Folder', 'blog_entries')
'blog_entries'
>>> blog_entries = self.portal.blog_entries
To enable MailDropbox functionality, we equip the folder with an additional marker interface:
>>> from zope.interface import alsoProvides >>> from mailtoplone.scrawl.interfaces import IScrawlMailDropBoxMarker >>> alsoProvides(blog_entries, IScrawlMailDropBoxMarker)
mailtoplone uses a more generic interface IMailDropBox, to adapt the context, we use that to call drop:
>>> from mailtoplone.base.interfaces import IMailDropBox
>>> IMailDropBox(blog_entries).drop("Subject: my first blog entry")
As result, we wexpect a single blog entry, with the title, id set according to the email’s subject:
>>> blog_entries.objectIds() ['my-first-blog-entry'] >>> blog_entry = blog_entries.listFolderContents()[0] >>> blog_entry.title u'my first blog entry' >>> blog_entry.portal_type 'Blog Entry'
Contributors
Hans-Peter Locher, Author Ramon Bartl
Download
Release files for mailtoplone.scrawl 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mailtoplone.scrawl-0.2.zip | 23.8 kB | Details |
Release files / mailtoplone.scrawl-0.2.zip
| Download URL | mailtoplone.scrawl-0.2.zip |
|---|---|
| Size | 23.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38c63f37638b33b6e9a820d12d6fd6cec513b99bb51aeb9d301dde9cd37e8409
|
|
BLAKE2b-256 checksum How to use checksums |
d06e34dffa860b450316c8e5d10b0993020a733c41168f46444ff1d207a00408
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |