Extension Email Notification


Extension Basics

Title
Email Notification
Name
ckanext-email-notification
Type
Public extension
Description
CKAN extension for sending email notifications to system admins about new user registrations and users without organization membership.
CKAN versions
Download-Url (zip)
Last commit
a year ago (2024-12-16 16:29:43)
Url to repo
Category
Authentication & Security


Background Infos

Description (long)
Show details

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:

  1. Registration Email: E-mail to system admins to inform them about new user registrations
  2. 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:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
    
  2. 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
    
  3. Add email-notification to the ckan.plugins setting in your CKAN config file.

  4. 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

Version
1.1.0
Version release date
2025-01-23
Contact name
TIB Hannover
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints

Add ‘email-notification’ to ckan.plugins. Requires cronjob setup for scheduled email notifications. Configure API key and server URL in cronjob commands.

Plugins to configure (ckan.ini)
email-notification
CKAN Settings (ckan.ini)
# Cronjob for registration emails (every 2 minutes):
# */2 * * * *  curl -H "Authorization:YOUR_API_KEY" http://localhost:5000/email_notification/user_reg

# Cronjob for reminder emails (daily at 16:00):
# 0 16 * * *  curl -H "Authorization:YOUR_API_KEY" http://localhost:5000/email_notification/reminder_email
DB migration to be executed
(not set)
<< back to Extensions