APIs & Integrations

Not applicable

Grab and set Follow up Email from Hubspot API

Hello,

I am trying get follow up emails in a form working from a .net website.

First how do I get the list of the emails to display on my website. and second how do I submit the form with it.
We call the workflow API to get the List of the Workflows, but I don’t see anything similar to the workflow api for the emails.

below is javascript we use create and submit the form.

hbspt.forms.create({
sfdcCampaignId: ‘<% = this.SfdcCampaignId %>’,
portalId: ‘<% = this.PortalId %>’,
formId: ‘<% = this.FormId %>’,
submitButtonClass: ‘hbspt-submit-button’,
inlineMessage: ‘<% = this.InlineMessage %>’,
redirectUrl: ‘<% = this.RedirectUrl %>’,
onFormReady($form, ctx) {

            var json = document.createElement('input');
            json.type = 'hidden';
            json.name = "jsonValues";
            json.value = '<%= this.GetJsonValues() %>';
            $form.children('form').append(json);
            //$('input.hs-input[value]').val('');
        },
        onFormSubmit: function ($form) {
            var f = $('.hbspt-form form');
            var jsonData = $form[0].lastChild;
            $.ajax({
                url: '/api/integration/HubSpotPost',
                type: 'POST',
                contentType: 'application/x-www-form-urlencoded',
                data: $(jsonData).serializeArray()
            });
        }

thanks

John

0 Upvotes
2 Replies 2
matt_scott
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Grab and set Follow up Email from Hubspot API

I'm also looking for a solution to this, I've got to the point where I can get a follow up email to work but as well as getting the follow up email ID (through the follow up email field in custom modules) I need the "Internal HubSpot ID" (found on the email performance page in the "See Details" popout

The following code therefore works:

hbspt.forms.create({
portalId: '',
formId: '',
followUpEmailId: ,
followUpEmailCampaignId: ,
inlineMessage: "",
target: '#myID',
});

What I want however is to get the the Internal Hubspot ID of the selected email automatically

Matthew Scott
Head of Development | Hubspot Solutions Architect

B2B marketing agency: Specialist B2B content marketing and demand generation for SaaS vendors and HubSpot Users | Deeply Digital | HubSpot Partner since 2010


01926 334003

deeplydigital.co.uk

3 Morton Street, Leamington Spa, CV32 5SY, UK
0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Grab and set Follow up Email from Hubspot API

Hi @Zheng_Li,

Follow-up emails can only be created in the UI for a specific landing page. It’s not possible to select/send a follow up email by customizing the embed code. If you have access to workflows, you can create a workflow in-app to send an email based on the form submission:

How can I send an email response after a form submission?

Learn how to create and set a follow-up email to automatically send to contacts who fill out a form on your page.

0 Upvotes