# Oribi Email API Integration

**URL:** <https://community.hubspot.com/t/oribi-email-api-integration/23787>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [August 5, 2020, 6:55am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787 "2020-08-05T06:55:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mounika](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mounika/32/21752_2.png) [@Mounika](https://community.hubspot.com/u/Mounika)\
**Post date:** [August 5, 2020, 6:55am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/1 "2020-08-05T06:55:23Z")

</div>

I want to add the Oribi Email integration to the forms on the website as per the client request and the following is the reference piece of code that should be added.

ORIBI.api(“setUserEmail”, \<replace variable name here\>)

But I have no idea about what to replace the variables in the above-mentioned code and where to add that piece of code to activate the email integration.

Can someone please guide me about this and thank you in advance.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 6, 2020, 6:24am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/2 "2020-08-06T06:24:50Z")

</div>

Hey @Mounika,

Just to clarify, are you looking to add oribi email integration on HubSpot forms?

---

<div class="post-metadata">

**Author:** ![Mounika](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mounika/32/21752_2.png) [@Mounika](https://community.hubspot.com/u/Mounika)\
**Post date:** [August 6, 2020, 7:40am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/3 "2020-08-06T07:40:32Z")

</div>

Yes, Can you please help me in adding it for the normal forms and for the follow-up email form where we used the email templates for the follow-up emails.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 7, 2020, 4:51am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/4 "2020-08-07T04:51:14Z")

</div>

Hey @Mounika,

When looking to customize the form embed code, you can explore this documentation: [How to customize the form embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options).

A sample example for your use case would be:

```auto
hbspt.forms.create({
 portalId: '',
 formId: '',
 onFormSubmit: function($form) {
ORIBI.api("setUserEmail", <replace variable name here>)
 } 
}); 

```

---

<div class="post-metadata">

**Author:** ![Mounika](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mounika/32/21752_2.png) [@Mounika](https://community.hubspot.com/u/Mounika)\
**Post date:** [August 12, 2020, 10:28am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/5 "2020-08-12T10:28:37Z")

</div>

Hey @WendyGoh

Thanks for the reply but I want to use that Oribi email integration to the drag-and-drop form module where we will give the follow-up email option to that form.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 13, 2020, 5:22am UTC](https://community.hubspot.com/t/oribi-email-api-integration/23787/6 "2020-08-13T05:22:51Z")

</div>

Hey @Mounika,

Thanks for the clarification!

If that’s the case, you’d need to add a form global events on the page javascript&colon; [Using Global Form Events](https://legacydocs.hubspot.com/global-form-events).

i.e.

```lia-code-sample
window.addEventListener('message', event => {
 if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') {
 ORIBI.api("setUserEmail", <replace variable name here>);
 console.log("Form Submitted!");
 }
});

```
