Feat/email notification after submission
Hey @fdis111 thanks a lot for your contribution to snoopForms 💪🤗 Receiving the email works great and it also only works after the submission is complete.
I think in the long term it would be great if an additional event submissionCompleted is emitted if it was the last pageSubmission in the form. That can be done by calling the function processApiEvent from itself with the new event. That way we can use this event also in the webhook and other potential integrations.
Also we can integrate the submission itself in the email to not having the need to leave the email program to see what people wrote (like e.g. Formspree does it).
But that are all things we can add later.
The only thing that bothers me at the moment is that you can't deactivate the emails. We have users on the platform who get more than 100 form submissions per week (and growing) and I don't like to spam them.
I think best way would be to build an integration similar to webhooks, where users can enter an email address and get notified when the integration is present and enabled. Do you have time and want to build that or would you like me building this on top of your code?
Hi @matthiasnannt , I think it's a good idea. I will implement it
@fdis111 is attempting to deploy a commit to the formbricks Team on Vercel.
A member of the Team first needs to authorize it.
@fdis111 Thanks a lot for the contribution 💪🤗
I just made a small change that the submissionCompleted event is fired in addition to a pageSubmission event. We use the "pageSubmission" events to calculate the responses in the results tab. Now submissionCompleted is a simple event without data on it's own.
I also liked your naming formCompleted better than submissionCompleted so I changed it everywhere in the code 😉
I also rebased the code to work with the new monorepository structure and ran the new prettier format config.
Thanks a lot for building this feature 🙏 It was highly requested by the community 💪🤗
I'm going to merge the code now... 🚢