I've been asked to fix a page that is supposed to send an email when the user has successfully filled out and submitted a form. The PL/SQL to send the email works fine. The problem is that the PL/SQL is executed when the Click event happens on a button where the second step of the DA is to submit the form.
So, of course, the user clicks the button, the email is sent, the validations run on the form, the user corrects errors, clicks the button again, and the email is sent again. Wrong!
I'm thinking that the correct place to put the PL/SQL is in a Dynamic Action on the Before Page Submit event. Am I right? If wrong, how would you do it?