Skip to content

Conversation

@joaquincasal
Copy link
Collaborator

@joaquincasal joaquincasal commented Jul 29, 2025

Purpose

Seamlessly sync Contentful entry content to email campaigns in Hubspot. Map entry fields to custom email modules in Hubspot to automatically keep content consistent at scale.

Approach

The app allows to create custom modules in Hubspot that can be used in emails. The modules are kept in sync with Contentful's content.

Screen.Recording.2025-07-29.at.17.37.12.mov

FBanfi and others added 30 commits June 17, 2025 09:47
)

* removing some locations and moving tests files

* adding cursor to gitignore
* adding base config structure and basic tests

* changing ConfigScreen.spec.tsx

* pr comments corrections
#9929)

* wip

* adding content type through config screen first version

* making ContentTypeMultiSelect component and tests

* refactor in config screen organization

* refactor using multiselect component

* fix prettier format

* refactor in tests + removing app through config screen

* refactor and creation of tests

* adding autocomplete option in the multiselect component

* removing redundant test

* removing unnecessary useCallBack
* Add function to create modules

* Update apps/hubspot/test/functions/createModules.spec.ts

Co-authored-by: JuliRossi <juliana.rossi@external.contentful.com>

* Update apps/hubspot/test/functions/createModules.spec.ts

Co-authored-by: JuliRossi <juliana.rossi@external.contentful.com>

---------

Co-authored-by: JuliRossi <juliana.rossi@external.contentful.com>
* first version of config screen validation function and tests

* correction of PR comments and refactor in config screen and validateHubspotToken function
* Add support for more field types

* Fix tests warnings

* Add support for images + refactor

* Modules function refactor

* Remove casting

* Use find* instead of waitFor in tests

* Fix entry title

* Fix nummer displayed in the 'select all' checkbox
)

* adding creation of config entry when installing the app

* refactor extract constant

* removing unused code

* changing description in createContentType from utils

* changing notifier error from config screen
* Copy updates

* Add gif to config screen

* Replace gif with video
* adding a config entry service

* changing ConnectedField type

* lazy get for config entry service

* removing getDefaultLocale function since it is not used anymore

* PR comments
* Add second dialog step

* Add Dialog styles file

* Show results after module creation

* Show error for unsupported characters in modules

* Disable inputs when sending

* Hubspot: validations update [] (#9962)

* Move token validation from config screen to dialog

* Update config screen instructions and video
* Show last synced time in sidebar

* Display error note in sidebar

* Update apps/hubspot/src/locations/Sidebar.tsx

Co-authored-by: Franco Banfi <62450599+FBanfi@users.noreply.github.com>

* Fix linter

---------

Co-authored-by: Franco Banfi <62450599+FBanfi@users.noreply.github.com>
* first version of app event handler function

* tests for appEventHandler.spec.ts

* adding test for ConfigEntryService file

* changing ConfigEntryService tests structure

* adding tests for ConfigEntryService and removing uninstall event

* removing old function from manifest

* PR corrections

* making default locale optional in ConfigEntryService
* Persist error in sidebar

* Refactor Dialog.showResults
* WIP save connected fields + config entry service refactor

* adding + fix in createModules.ts

---------

Co-authored-by: joaquin <joaquin.casal@10pines.com>
* first version of update on save event + some tests

* adding refactor to the appEventHandler tests

* rename from test

* Fix linter

* changin place of call and retry

* refactor: passing only the hubspot token to function

* early return if entry is not synced + new test

* fix test

---------

Co-authored-by: joaquin <joaquin.casal@10pines.com>
* Hubspot: Enhance text field handling in module creation [INTEG-2785]

* Added support for long text fields in createModules.ts
* Introduced LONG_TEXT_MODULE_TEMPLATE in templates.ts
* Updated logic to format text field values as HTML paragraphs

* Hubspot: Update module templates for rich text handling

* Add tests

* fix rebase

* Hubspot: Refactor module creation by extracting createModuleFile and error classes

* Hubspot: Update appEventHandler test to use rich text field template for module creation
* Hubspot: Update configuration screen instructions for clarity

* Add tooltip to FieldCheckbox for unsupported syncing indication

* Remove audio from hubspot.mp4

* Remove isVisible prop from Tooltip in FieldCheckbox component

* Update title in ConfigEntryService to include warning against deletion
* page location table

* adding styles

* removing property from mock in test

* refactors in styles and types

* modifying tests and page components
* wip adding test

* Fix tests

* wip adding types for the connected entry modal

* wip fixing tests

* Refactoring and polishing page

* Modal refactor

* Fix typos in messages and update test assertions for connected fields

* Refactor displayType function to use FieldItems type for better type safety

* refactor to fix warning

* changing modal header title and content to match the figma

* reducing the padding of the modal to match the figma

* refactor in the page empty and error cases

* adding test for empty and error table cases

---------

Co-authored-by: Juli Rossi <juliana.rossi@external.contentful.com>
…9997)

* adding error badges in Page table and modal

* removing warning oct component + styles changes
* Disconnect functionality

* remove unused import

* re-adding tests

* Removing unused parameter

* Fix rebase

* Prettier
JuliRossi and others added 10 commits July 24, 2025 10:35
* Enhance FieldSelection component to include connected field IDs and update tooltip behavior. Fetch connected fields in Dialog component and pass them to FieldSelection. Update tests to verify checkbox states for connected fields.

* remove parameter
…9996)

* fixing update method in config entry service

* changing createModules function to send all the fields to the update

* adding test for updateConnectedFields
…G-2971] (#10015)

* changing page table to display content type name

* changing page modal to display field name instead of id

* inlining content type name in page table

* formating prettier
* Add getting started images and enhance ConfigScreen layout

* Enhance ConfigScreen by adding alt text for images in GettingStartedStep component

* Add test for Getting Started section in ConfigScreen with image alt text checks

* Fixes per comments
* Update dependencies and add event subscription script for Hubspot integration

* Testing first approach

* Remove dotenv/config from setupFiles in vitest configuration

* Refactor tests for createAppEventSubscription to improve type safety and error handling
* adding error handling for duplicated names

* prettier

* Refactor FieldModuleNameMapping to improve validation handling and error management

* removing useEffect

* refactor removing useEffect

---------

Co-authored-by: Juli Rossi <juliana.rossi@external.contentful.com>
@joaquincasal joaquincasal requested a review from a team as a code owner July 29, 2025 20:17
@netlify
Copy link

netlify bot commented Jul 29, 2025

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit cfdc16e
🔍 Latest deploy log https://app.netlify.com/projects/ecommerce-app-base-components/deploys/68892c86ca5404000719d1f2

Copy link
Contributor

@ryunsong-contentful ryunsong-contentful left a comment

Choose a reason for hiding this comment

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

Nothing breaking and overall looks good. My comments are more about slight code quality improvements rather than anything breaking or fundamental issues

errorMessage: string
) {
const hasValue = !!value?.trim();
setError(hasValue ? null : errorMessage);
Copy link
Contributor

Choose a reason for hiding this comment

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

Checkers shouldn't set other params like this, violates SRP (single-responsbility-principal)

);

if (!hubspotTokenHasValue) {
sdk.notifier.error(EMPTY_MESSAGE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to the above comment - this is now slightly awkward where one has to understand why setHubspotTokenError isn't called here (because it's somehow already handled in the checker).

async function deleteConfigEntry(cma: PlainClientAPI) {
try {
await cma.entry.unpublish({ entryId: CONFIG_ENTRY_ID });
} catch (e) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we at least not log the errors if these things fail to at least make debugging easier

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some of these calls are expected to fail in some cases (when the entry is not published). And this runs when the app gets uninstalled, so logs would be lost immediately after


interface SplitterProps extends CommonProps, MarginProps, PaddingProps {}

const Splitter = (props: SplitterProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add this to the discussion with Sarah about adding this to the component library

const [modalOpen, setModalOpen] = useState<boolean>(false);

return <Paragraph>Hello Page Component (AppId: {sdk.ids.app})</Paragraph>;
const cma = createClient(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be created on every re-render? Could insert a useMemo here. I think I saw something similar in ConfigScreen.tsx

});
return { entry, contentType };
} catch (err) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably do something better here no?

@joaquincasal joaquincasal merged commit dc84283 into master Jul 30, 2025
18 checks passed
@joaquincasal joaquincasal deleted the hubspot branch July 30, 2025 15:05
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.

5 participants