Feed your Plone Site with Mails
Use cases
- Create instant content from mobile and work on later on desktop
- Display newsletters. Do it searchable.
- Mail reports, bills, snapshots, etc. as attachments to Plone pages.
The service rohberg.mailin listens to incoming mails of defined mail accounts and sends a request to Plone website. This request creates content in Plone.
Download code to arbitrary location and install with
yarn install
configure with config.env
and start with
yarn mailin
Configuration is made in config.env. See an example configuration at config.env.example
IMAP_USER = foo@gmail.com
IMAP_PASS = abc
IMAP_HOST = imap.gmail.com
IMAP_PORT = 993
WEBHOOK_TARGET = 'http://code.example.com'
PLONE_LOGIN = 'admin'
PLONE_PASSWORD = 'secret'
PLONE_CONTENTTYPE = 'mycontenttype'
ALLOWED_SENDERS = 'foo@gmail.com,bar@gmail.com'
Plone configuration
- plone.restapi is installed.
- User PLONE_LOGIN has write access to WEBHOOK_TARGET for PLONE_CONTENTTYPE.
Dependencies
mail-notifier https://www.npmjs.com/package/mail-notifier
No dependency on Plone. config.env defines the target. This target can be anything.
Content Tagging
Categorize your content with tags by appending them to the mail subject.
Example subject of Mail: my note #Python #Plone
Credits
Thank you Harjyot Singh for inspiration.
Thank you jcreigno for mail-notifier.
Testing
Add your test email to ALLOWED_SENDERS and send an email from this account to IMAP_USER. This creates a first content item in Plone at WEBHOOK_TARGET.
Get it: rohberg.mailin
Update 04.07.2019:
Additional use case: posting attachments
Content tagging by adding tags to mail subject