When the fundraising team moderates a donation that was automatically held back for some reason, the system should send an email. Since the moderation is happening in the management and analytics application, it might be an issue with the status of the data set (e. g. some flag being set incorrectly).
Right, the management and analytics software (a. k. a. backend) was triggering the frontend application to send the notification mail. If I remember correctly this was happening mainly because it had no infrastructure to access the CMWiki (which is needed to fetch the content of the e-mails).
If I remember correctly this was happening mainly because it had no infrastructure to access the CMWiki (which is needed to fetch the content of the e-mails).
Do you think that still makes sense? You wrote this with past tense, so I'm wondering if we still have that restriction.
Assuming it is still there, how about tackling that rather than adding a UC to the frontent app for something the backend one needs? Or is there some reason to not do that?
Where should I look to find the poking code in the backend app?
I think it's a good idea to let all of it happen in the backend application. But it's way more effort to introduce the page fetching stuff. We would also need Twig (or some other templating engine) then.
The backend application uses the class FundraisingFrontendService to asychronously call the respective action.
I'll have a look at how difficult it looks to share the relevant code with the backend app. Right now the backend app has nothing like WikiRip right? (Edit: I certainly can't find anything)
Edit: as far as I can tell the code we'd want to share is
- PageRetriever and derivatives
- Perhaps TwigFactory, though this one will need refactoring
That's not a lot, and easy enough to do. We'd need a little new code in the backend repo to use those things, though that should be easy as well. I considered TemplateBasedMailer and TwigTemplate, but both seem odd to put together with the basic templating stuff, and are easily enough replaced by something else.
Progress on this:
- We figured creating a component for just the PageRetriever stuff would be better and just having dedicated Twig code in the backend app. New component: https://github.com/wmde/PageRetriever
- Then we realized that the confirmation sending really belongs to the associated context of the frontent, and the backend should just send a domain event such as "donation confirmed" to the frontent.
While the linked PRs have been merged, it'd be good to test that the stuff actually works when putting it together (and actual backend sending stuff to an actual frontent) before closing this.