open-saas
open-saas copied to clipboard
Reconsider Job `emailChecker`
Is this job really needed? Seems a bit like redundant functionality. We do have job dailyStatsJob to showcase jobs.
I would consider dropping job emailChecker from open-saas.
Or, let’s at least make it a bit more interesting / practical: let’s make it send weekly summary to each user, of their activities. And give it a better name then also, like emailWeeklySummary. Yeah I can see myself using that. is that easy to make without knowing more about the app though?
Btw what if users don’t see that they have this job in their app → I can easily imagine them not noticing (it is at the end of the main.wasp file and you don't see its effects unless it hits Monday at 7am), and then in production email suddenly gets sent to users! So maybe by default this should be turned off somehow? Or we should delete it hm. I like the functionality being there if we need it, but it is a bit much / can cause problems.
TLDR: I would either delete it, or make it more practical + make sure they have to somehow enable it and not have it working by default.
@Martinsos I extracted this job in the recent vertical code organization leftovers to src/newslertter . I also renamed it to checkAndQueueNewsletter, which corresponds to a user.sendNewsletter property. At the moment, it's inactive (sendNewsletter defaults to false and there's no way in the UI to activate it yet) and just exists in the codebase as an additional example of using recurring jobs with the email sender. https://github.com/wasp-lang/open-saas/blob/main/template/app/src/newsletter/sendNewsletter.ts
Maybe it's a bit impractical at the moment, but I think it's a decent example they can plug in and customize if they want.