ckanext-email-notification
A CKAN extension for sending email notifications to system admins. This extension helps administrators stay informed about user activity and membership status in their CKAN instance.
Included Plugin(s)
email_notification: This plugin sends two types of emails:
- Registration Email: E-mail to system admins to inform them about new user registrations
- Reminder Email: Reminds system admins about users without organization membership in CKAN
Requirements
Compatibility with core CKAN versions:
| CKAN version |
Compatible? |
| 2.9 |
Yes |
| earlier |
Not Tested |
Installation
To install ckanext-email-notification:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Clone the source and install it on the virtualenv:
git clone https://github.com/TIBHannover/ckanext-email-notification.git
cd ckanext-email-notification
pip install -e .
pip install -r requirements.txt
Add email-notification to the ckan.plugins setting in your CKAN config file.
Restart CKAN.
Config Settings
Registration Email
This plugin checks the users (obtained via CKAN API) creation date in the user table in CKAN database and sends e-mail to users who registered in the past 2 minutes.
Set a job in the system cronjob list to call this plugin every 2 minutes:
*/2 * * * * curl -H "Authorization:YOUR_API_KEY" http://localhost:5000/email_notification/user_reg
- YOUR_API_KEY is the CKAN API key which you need to create.
- Replace “http://localhost:5000/” with the target server.
NOTE: If you like to change the 2 minutes time interval, you can change it in “controller/controllers.py”, the variable “TIME_DELTA” (in seconds)
Reminder Email
You can set it on cronjob list to send this email in your desired time interval. For example, once a day at 16:00:
0 16 * * * curl -H "Authorization:YOUR_API_KEY" http://localhost:5000/email_notification/reminder_email
License
AGPL-3.0 license