onFromSubmit: email being sent twice

Hi there,

I have an ajax call that sends some data inside onFormSubmit. The problem we’re having is that our Sales team is receiving two emails per email address, belonging to the submition of the form, and another one to the ajax call inside the onFormSubmit function.

Is there a way to get rid of the feault email sent on submition?
Thanks

Hi, @romidg.

Thanks for reaching out.

It sounds like you’ve modified an embedded HubSpot form and the email value in the default form field is different than one you’re sending with the onFormSubmit event. Is that correct?

If so, I don’t know of a way to discard the default email value but you could overwrite the value with your onFormSubmit logic.

To give more concrete recommendations, though, I’ll have to see your implementation. Could you share a link to the form and a link to a contact record showing this behavior?

Thanks Issac,

I just removed my ajax call inside my onFormSubmit, and changed the valued of the form in a different way, that solved the double email being sent.