Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(www): custom hubspot submission for newsletter #9197

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Oct 18, 2018

so this is very hacky but seems to work:

povpu6vt3a

I was using my throwaway form to not mess with submissions + it didn't have "SFDC Campaign" - it should be fine (if docs at https://developers.hubspot.com/docs/methods/forms/submit_form_ajax are correct).

And also disabled default html input verification for this gif - with type="email" + required attr, field validation should be handled by browsers (with hubspot server validation being fallback)

This doesn't make use of HubSpot usertoken - but it seems we currently don't use anyway, so there shouldn't be regression in this area (please check hubspot docs linked above for explanation of the token)

Note this PR is against @fk branch that re-adds newsletter form to homepage ( #9183 )

/cc @fk @calcsam

@pieh pieh requested a review from a team as a code owner October 18, 2018 01:34
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good solution to the problem. Wouldn't call it all that hacky 👍

data.context.sfdcCampaignId = sfdcCampaignId
}

const xhr = new XMLHttpRequest()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D give me some fetch love and tell world IE is not a thing anymore to not throw in polyfills :)

@fk
Copy link
Contributor

fk commented Oct 18, 2018

🙏 !!!

@fk fk merged commit 4063bd9 into gatsbyjs:topics/www-add-newsletter-to-homepage-again Oct 18, 2018
@pieh pieh deleted the topics/www-add-newsletter-to-homepage-again branch October 18, 2018 15:50
@pieh pieh restored the topics/www-add-newsletter-to-homepage-again branch May 17, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants