Oribi Email API Integration

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.

Hey @Mounika,

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

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.

Hey @Mounika,

When looking to customize the form embed code, you can explore this documentation: How to customize the form embed code.

A sample example for your use case would be:

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

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.

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.

i.e.

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