def send_email_notifications(context, data_dict): '''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 ...` command. ''' _check_access('send_email_notifications', context, data_dict) if not config.get_value('ckan.activity_streams_email_notifications'): raise ValidationError('ckan.activity_streams_email_notifications' ' is not enabled in config') email_notifications.get_and_send_notifications_for_all_users()
def send_email_notifications(context, data_dict): """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 ...` command. """ # If paste.command_request is True then this function has been called # by a `paster post ...` command not a real HTTP request, so skip the # authorization. if not request.environ.get("paste.command_request"): _check_access("send_email_notifications", context, data_dict) if not converters.asbool(config.get("ckan.activity_streams_email_notifications")): raise ValidationError("ckan.activity_streams_email_notifications" " is not enabled in config") email_notifications.get_and_send_notifications_for_all_users()
def send_email_notifications(context, data_dict): '''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 ...` command. ''' # If paste.command_request is True then this function has been called # by a `paster post ...` command not a real HTTP request, so skip the # authorization. if not request.environ.get('paste.command_request'): _check_access('send_email_notifications', context, data_dict) if not config.get_value('ckan.activity_streams_email_notifications'): raise ValidationError('ckan.activity_streams_email_notifications' ' is not enabled in config') email_notifications.get_and_send_notifications_for_all_users()
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/token in the Authorization header of the request, or call this action from the command-line via a `ckan notify send_emails ...` command. ''' _check_access('send_email_notifications', context, data_dict) if not config.get_value('ckan.activity_streams_email_notifications'): raise ValidationError({ 'message': 'ckan.activity_streams_email_notifications' ' is not enabled in config' }) email_notifications.get_and_send_notifications_for_all_users()