Custom extandable mailer for CKAN
Project description
ckanext-mailcraft
The ckanext-mailcraft
extension provides next features:
- A custom mailer that can be conveniently expanded as needed
- Prestyled email template
- A dashboard where you can view a list of all sent e-mails
- A function of stopping the sending of all emails sent through our mailer in order to debug the functionality.
To enable the extension, add mailcraft
to the ckan.plugins
setting in your CKAN.
If you want to enable the dashboard you should also add mailcraft_dashboard
to the ckan.plugins
setting.
Usage
To use a mailer, you just have to import it.
from ckanext.mailcraft.utils import get_mailer
mailer = get_mailer()
mailer.mail_recipients(
subject="Hello world",
recipients=["test@gmail.com"],
body="Hello world",
body_html=tk.render(
"mailcraft/emails/test.html",
extra_vars={"site_url": mailer.site_url, "site_title": mailer.site_title},
),
)
Dashboard
The mailcraft dashboard requires the ckanext-admin-panel
extension to be enabled. Otherwise, there most likely will be
an exception, cause we're heavily relying on the admin panel and some extra requirements of it.
Requirements
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|
| 2.9 and earlier | no | | 2.10+ | yes |
Installation
Use PyPI to install the extension with pip. Or check the Developer installation section.
Config settings
There's a separate page in admin panel to configure mailcraft settings. Check the config_declaration.yaml
file.
Developer installation
To install ckanext-mailcraft for development, activate your CKAN virtualenv and do:
git clone https://github.com/mutantsan/ckanext-mailcraft.git
cd ckanext-mailcraft
python setup.py develop
pip install -r dev-requirements.txt
Tests
To run the tests, do: pytest --ckan-ini=test.ini
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext_mailcraft-0.2.1.tar.gz
.
File metadata
- Download URL: ckanext_mailcraft-0.2.1.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7ba92c89f8d6d98a2864dc951267d768cd0f3b277bd49ffd69c5d28b365c0a |
|
MD5 | f68e5828bce7164e375beab8f649c41a |
|
BLAKE2b-256 | abcdbd48237a429be3364efc88b6968bb7344ea6c3720f9ca72ad8ef5d5eda4a |
File details
Details for the file ckanext_mailcraft-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: ckanext_mailcraft-0.2.1-py3-none-any.whl
- Upload date:
- Size: 35.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faa9bac8e1a82e36c4e82d5bc61dde01d60b4a4401326883a4a550c69ad6ec5e |
|
MD5 | 200493709a02f3de0a0428852bf10ac0 |
|
BLAKE2b-256 | 078416469b27114fab2b3d5472a6ac54e3ee41360806b824221831e9176672b6 |