Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Release License: GPL v3

CKAN

ckanext-email_notify

ckanext-email_notify is a CKAN extension that automatically sends email notifications to the administrators. It covers three notification types:

  • New user registrations – alerts when accounts are created within a configurable time window.
  • Users without an organisation – reminds administrators to assign orphaned accounts to a group or organisation.
  • Importation updates – reports the outcome of automated dataset imports, including schema validation status and error details.

All notifications are delivered via cron jobs that call lightweight HTTP endpoints protected by an API key.

Installation

As usual for CKAN extensions, you can install ckanext-email_notify as follows:

git clone https://github.com/SDM-TIB/ckanext-email_notify.git
pip install -e ./ckanext-email_notify
pip install -r ./ckanext-email_notify/requirements.txt

After installing the extension, enable it following the instruction below:

  1. Add email_notify to the ckan.plugins setting in your CKAN configuration file (default: /etc/ckan/default/ckan.ini):
   ckan.plugins = ... email_notify
  1. Set the required email_notify.api_key option (see Configuration Options). Without it, no cron jobs are registered and all notification endpoints return 403.

The extension registers cron jobs automatically on startup via IConfigurer.

Configuration Options

All options go in your CKAN .ini file.

Required

Option Description
email_notify.api_key Secret key sent as the Authorization header to protect notification endpoints. No cron jobs are created and all endpoints return 403 if this is unset.

Email Delivery

Option Default Description
email_notify.sender_name LDM-Sysadmin Display name used as the email sender.
email_notify.sender_email noreply.ldm@tib.eu Sender email address.
email_notify.recipients (sysadmin emails) Space- or comma-separated list of recipient addresses. Falls back to the email addresses of all CKAN sysadmin accounts when not set.

New-User Notifications

Option Default Description
email_notify.new_users_notify_enabled false Set to true to enable periodic new-user notifications.
email_notify.new_users_deltatime 2 Polling interval in minutes (1–59). Accounts created within this window are included in the notification.

Users-Without-Organisation Notifications

Option Default Description
email_notify.users_without_org_notify_enabled false Set to true to enable the periodic reminder.
email_notify.users_without_org_notify_recurrence 0 16 * * * Standard crontab expression controlling when the reminder fires.

Cron / System

Option Default Description
email_notify.crontab_user root System user whose crontab the extension writes to.
ckan.activity_streams_email_notifications false Standard CKAN option. When true, the extension also registers an hourly cron job to flush CKAN's built-in activity-stream notifications.

HTTP Endpoints

All endpoints require the Authorization header to match email_notify.api_key.

Endpoint Description
GET /send_new_user_email Sends the new-user notification email immediately.
GET /send_noorganization_user_email Sends the users-without-organisation reminder immediately.
GET /test_render_notification_email Renders the new-user email template with fixture data and returns the HTML — useful for visual testing.
GET /test_send_email Sends a plain test email and returns SMTP configuration details.
GET /test_send_email_using_object Sends a fixture importation-update email and returns SMTP configuration details.

Changelog

If you are interested in what has changed, check out the changelog.

License

ckanext-email_notify is licensed under AGPL-3.0, see the license file.

About

CKAN extension implementing a notification system sending emails to administrators

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages