Skip to content

Commit

Permalink
Adds mailer to the toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Dec 20, 2019
1 parent 3cd4345 commit efb18ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/plugins/toolkit.py
Expand Up @@ -108,6 +108,10 @@ class _Toolkit(object):
'HelperError',
# Enqueue background job
'enqueue_job',
# Email a recipient
'mail_recipient',
# Email a user
'mail_user',

# Fully defined in this file ##
'add_template_directory',
Expand Down Expand Up @@ -148,6 +152,7 @@ def _initialize(self):
HelperError
)
from ckan.lib.jobs import enqueue as enqueue_job
from ckan.lib import mailer

import ckan.common as converters
if six.PY2:
Expand Down Expand Up @@ -269,6 +274,8 @@ def _initialize(self):
t['auth_disallow_anonymous_access'] = (
logic.auth_disallow_anonymous_access
)
t['mail_recipient'] = mailer.mail_recipient
t['mail_user'] = mailer.mail_user

# class functions
t['render_snippet'] = self._render_snippet
Expand Down

0 comments on commit efb18ff

Please sign in to comment.