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: add users to Hubspot on creation #21

Merged
merged 5 commits into from
Aug 29, 2024

Conversation

codeincontext
Copy link
Collaborator

@codeincontext codeincontext commented Aug 28, 2024

Description

We need to send users to hubspot to be able to send them communications and track their email preferences

  • Add hubspot client to core package
  • Call hubspot client with user details when onboarding

Once this work is deployed I will make sure that existing users are up to date in Hubspot. I already have a script to export preferences to a CSV. If that's not useful for the team, I can adapt it to use this client

How to test

  1. Create a new user with a first and last name. Domain: https://oak-ai-lesson-assistant-j28vnq7f4.vercel-preview.thenational.academy
  2. Submit the onboarding form
  3. Check hubspot (staging)
  4. That the first and last name are there
  5. That the marketing preference is recorded: Go to "Actions" => "View all Properties" => Search for "email_consent_on_ai"

Test with the checkbox both enabled and disabled
Test with an email that already exists in hubspot, and a new account

Checklist

  • Manually tested across browsers / devices
  • Considered impact on accessibility
  • Does this PR update a package with a breaking change

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2024 9:52am

Copy link

github-actions bot commented Aug 28, 2024

Playwright e2e tests

Job summary

Download report

To view traces locally, unzip the report and run:

npx playwright show-report ~/Downloads/playwright-report

@codeincontext codeincontext marked this pull request as ready for review August 28, 2024 16:34
undefined,
undefined,
undefined,
undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like they could change the signature here!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I'm actually a little unimpressed by that package in general. For example, it doesn't export their error instances

);
id = result.id;
} catch (e) {
if (e instanceof ApiException && e.code === 404) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the 404 saying here?

If it means no user found then we wouldn't want to return early, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Guessing it doesn't mean that if the code is successfully creating new hubspot entities

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, you're right. Well spotted as I thought I had tested that

Copy link
Collaborator

@mantagen mantagen left a comment

Choose a reason for hiding this comment

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

Nice one!

Copy link

@codeincontext codeincontext merged commit 99411b7 into main Aug 29, 2024
12 checks passed
@codeincontext codeincontext deleted the feat/hubspot-backend-creation branch August 29, 2024 11:31
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

mantagen pushed a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants