# onFromSubmit: email being sent twice

**URL:** <https://community.hubspot.com/t/onfromsubmit-email-being-sent-twice/22897>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [July 15, 2020, 10:39am UTC](https://community.hubspot.com/t/onfromsubmit-email-being-sent-twice/22897 "2020-07-15T10:39:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![romidg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/romidg/32/82448_2.png) [@romidg](https://community.hubspot.com/u/romidg)\
**Post date:** [July 15, 2020, 10:39am UTC](https://community.hubspot.com/t/onfromsubmit-email-being-sent-twice/22897/1 "2020-07-15T10:39:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [July 16, 2020, 4:02pm UTC](https://community.hubspot.com/t/onfromsubmit-email-being-sent-twice/22897/2 "2020-07-16T16:02:37Z")

</div>

Hi, @romidg.

Thanks for reaching out.

It sounds like you’ve [modified an embedded HubSpot form](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options) 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?

---

<div class="post-metadata">

**Author:** ![romidg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/romidg/32/82448_2.png) [@romidg](https://community.hubspot.com/u/romidg)\
**Post date:** [July 17, 2020, 8:38am UTC](https://community.hubspot.com/t/onfromsubmit-email-being-sent-twice/22897/3 "2020-07-17T08:38:25Z")

</div>

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.
