Database Email Notification

Hi there,
I have created a lightbox with 3 options within… it is connected to a database and connects without issue however i cannot seem to make the database notify me of any selections.
This is not created as a form thus i cannot find it within automations and seem unable to get notified of changes to this database any advice please?

You can easily script this with JS code on your lightbox. I did it by adding the sendgrid/mail package into the code by adding it via the Install Module feature if you click on the wheel cog on the node_modules on the left tree of your site. Once this is in your code, you can create a little piece of code on the event for your dataset save - i triggered it as follows in my forms (your lightbox) onReady() event:

$w(“#dataset1”).onAfterSave(sendFormData);

sendFormData() is a method i created on my site to parse the form data and send it as a email to alert whenever my custom form has been submitted a new dataset entry. There are lots of examples on here with how to use sendMail from js code you should be able to follow.


Daniel Brum,
Thanks a mil i done some research on this and looks legit, however i fear this may be above my pay grade lol, i do not know coding and feel horribly confused by the steps stated on this link, https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission#backend-functions do you maybe have any additional links that make it a little easier to understand?