Skip to content

Commit

Permalink
add/update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
cirun authored and cirun committed Mar 29, 2022
1 parent 46931a5 commit 0002c69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion ckan/cli/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import click
from ckan.model import Session, Package, DomainObjectOperation
from ckan.model.modification import DomainObjectModificationExtension
from ckan.views.resource import NotAuthorized, ValidationError
from ckan.logic import NotAuthorized, ValidationError


log = getLogger(__name__)
Expand All @@ -24,6 +24,17 @@ def replay():

@notify.command(name="send_emails", short_help="Send out Email notifications.")
def send_emails():
"""
As currently implemented, it will only send notifications from dashboard
activity list.
It will send emails to users who have `activity_streams_email_notifications`
set in their profile.
It will send emails with updates depending on how `ckan.email_notifications_since`
is configured.
The default value is 2 days.
"""
import ckan.logic as logic
import ckan.lib.mailer as mailer
from ckan.types import Context
Expand Down
4 changes: 2 additions & 2 deletions ckan/logic/action/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,8 @@ def dashboard_mark_activities_old(
def send_email_notifications(context: Context, data_dict: DataDict) -> ActionResult.SendEmailNotifications:
'''Send any pending activity stream notification emails to users.
You must provide a sysadmin's API key in the Authorization header of the
request, or call this action from the command-line via a `paster post ...`
You must provide a sysadmin's API key/token in the Authorization header of the
request, or call this action from the command-line via a `ckan notify send_emails ...`
command.
'''
Expand Down

0 comments on commit 0002c69

Please sign in to comment.