Skip to main content

addon for mailtoplone creating Scrawl Blog Entries

Project description

Dependencies

mailtoplone.base:

Scrawl:

Example buildout

buildout:

Change history

Changelog

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

Download

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

mailtoplone.scrawl-0.1.zip (23.5 kB view details)

Uploaded Source

File details

Details for the file mailtoplone.scrawl-0.1.zip.

File metadata

File hashes

Hashes for mailtoplone.scrawl-0.1.zip
Algorithm Hash digest
SHA256 a90c4e00455c6f7150300e9c33a3204f652ca43c0482461a6e2cbfacdf7732dd
MD5 a0bf31290d0273cc181afdbf2667154a
BLAKE2b-256 f0df49750b527175302baa42529003cf32e098479754c7ce989c581e8123c7f7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page