Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose INotifier #8200

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Propose INotifier #8200

wants to merge 11 commits into from

Conversation

avdata99
Copy link
Member

@avdata99 avdata99 commented Apr 26, 2024

Proposed fixes:

In different CKAN projects I'm using Sendgrid and Slack to notify users. I assume other users have similar requirements.
Sometimes we don't have (and don't need) an SMTP server.

I think it will be nice to allow users to work without SMTP and define custom notification services (or don't notify at all)
I started this PR to:

  • Propose a new INotifier interface to allow extension to notify in different ways.
  • Propose to stop trying to send email when there is no available settings to do it

I know this will require more work but I want to be sure that this is a good idea.

Features:

  • includes tests covering changes
  • includes updated documentation
  • includes user-visible changes
  • includes API changes
  • includes bugfix for possible backport

Please [X] all the boxes above that apply

@wardi wardi self-assigned this Apr 30, 2024
@mackeynichols
Copy link

Hey @avdata99 👋
Do you envision this including notifying external apps via an HTTP request (like a webhook)?

It sounds like it might be a bit out of scope 😅 but I wanted to ask

@avdata99
Copy link
Member Author

Hey @avdata99 👋 Do you envision this including notifying external apps via an HTTP request (like a webhook)?

Yes @mackeynichols, this change will allow you to implement INotifier in your extension and notify with any method.
I'll probably release a ckanext-sendgrid extension as an example.

@wardi
Copy link
Contributor

wardi commented Apr 30, 2024

This is a related extension by @JVickery-TBS for using "gcnotify" (a fork of https://www.notifications.service.gov.uk/ ) for sending ckan emails: https://github.com/open-data/ckanext-gcnotify

Right now it works by monkey patching ckan core, a proper interface like the one you propose would be much nicer.

@JVickery-TBS
Copy link
Contributor

JVickery-TBS commented Apr 30, 2024

Yeah, would be nice to have an implement to extend emails instead of just monkey patching the mailer script

+ 1

@avdata99
Copy link
Member Author

This is a related extension by @JVickery-TBS for using "gcnotify" (a fork of https://www.notifications.service.gov.uk/ ) for sending ckan emails: https://github.com/open-data/ckanext-gcnotify

Thanks @wardi, that's what I'm doing now. It ~works but not for all cases.
For internal CKAN notification it fails (at least for me). Notifications whitin the extension works but CKAN internal notification (e.g. invite a user) fails.

@avdata99
Copy link
Member Author

avdata99 commented May 6, 2024

I think this is ready for review @wardi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants