Closed tbembersimeao closed 4 years ago
Hi @tbembersimeao I was reading through your proposal and I think it is very interesting and I see people wanting to send emails on different levels than by project/record.
While checking on the proposal, the only thing I see is, for the second link in the control center, to go to the same code without duplicating it as they are going to be almost identical. I'm not sure if this was your idea but just wanted to point that out.
Also, how about if a project has the email alerts enabled, add a second tab named "Global Alerts" only for admins to see and maybe manage those global alerts? I thought it might be useful for admins managing alerts on a project to quickly see the global ones activated.
@knil-maloon thanks for your quick reply!
Answering your points:
I'm not sure if this was your idea but just wanted to point it out.
Yes, that's what I meant. My idea is having a common template that renders the config page according to the the given context (e.g. checks whether PROJECT_ID
constant is defined).
Also, how about if a project has the email alerts enabled, add a second tab named "Global Alerts"
I think that would be great! A simpler alternative to that would be displaying a link to the Control Center's page ("Manage global alerts here").
I think it is very interesting and I see people wanting to send emails on different levels than by project/record
That's great! How do want to proceed? Do you want to coordinate the implementation from the beginning or you want me to create a PR so you review it from that point? Either way works for me.
Feel free to make the changes, create a pull request and we will review it :)
Hi @tbembersimeao just letting you know that I made a big update on the email alerts that will allow to schedule emails. We're just going to test it now so it's still not ready to go but I thought I should mention it :)
@knil-maloon thanks for letting me know!
@tbembersimeao no problem. I will let you know once it's finished
@tbembersimeao we just released the version 2.0 with the scheduled emails.
Motivation and thoughts
My team is developing a module that needs a UI to configure and send emails. This will be the third time we are facing this sort of task in the past months. I would like to stop copying code between modules. I'd like to do something more reusable.
In researching this I was looking into Email Alerts. I'd really like to use the great UI this module provides. However, the only triggering event available is instrument submission. We need the ability to build a custom trigger.
It would be helpful to me and my work to extend/plugin Email Alerts functionality in terms of 1) triggers and 2) Piping variables. I imagine the technical features would work like this:
User workflow modifications
The end User workflow would have these modifications:
Code snippets from a trigger-declaring module
This is a sketch of what a trigger-declaring module would look like - let's say we want to trigger notifications when a new project is created:
Trigger declaration hook
Triggering an event
Architecture changes needed within email-alerts-module
Below is a sketch of a new method that checks for additional available triggers. The values returned by this method would be used to extend the list of available triggers in the UI and display any added piping variables available to the user.
Below is a example of how the emails could be sent by Email Alerts.
Final comments
I know this would be a huge shift, but if the maintainers are open to move this project towards this direction, I'd be glad to work on it and submit a PR. It would be less work for me than building all of this functionality from scratch.
Anyway, your input and ideas would be really appreciated.
Thank you!