Skip to content

Commit fb9d72c

Browse files
Hai Toschlattk
Hai To
authored andcommitted
Source Hubspot: Add new marketing emails (with statistics) stream (airbytehq#5840)
* Add new marketing emails (with statistics) stream * Update docs and changelog
1 parent 2afa799 commit fb9d72c

File tree

7 files changed

+563
-2
lines changed

7 files changed

+563
-2
lines changed

airbyte-integrations/connectors/source-hubspot/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ RUN pip install .
1414

1515
ENV AIRBYTE_ENTRYPOINT "/airbyte/base.sh"
1616

17-
LABEL io.airbyte.version=0.1.17
17+
LABEL io.airbyte.version=0.1.18
1818
LABEL io.airbyte.name=airbyte/source-hubspot

airbyte-integrations/connectors/source-hubspot/sample_files/configured_catalog.json

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@
9393
"sync_mode": "full_refresh",
9494
"destination_sync_mode": "overwrite"
9595
},
96+
{
97+
"stream": {
98+
"name": "marketing_emails",
99+
"json_schema": {},
100+
"supported_sync_modes": ["full_refresh"],
101+
"source_defined_cursor": false,
102+
"default_cursor_field": ["updated"]
103+
},
104+
"sync_mode": "full_refresh",
105+
"cursor_field": null,
106+
"destination_sync_mode": "overwrite"
107+
},
96108
{
97109
"stream": {
98110
"name": "owners",

airbyte-integrations/connectors/source-hubspot/sample_files/configured_catalog_for_oauth_config.json

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@
9393
"sync_mode": "full_refresh",
9494
"destination_sync_mode": "overwrite"
9595
},
96+
{
97+
"stream": {
98+
"name": "marketing_emails",
99+
"json_schema": {},
100+
"supported_sync_modes": ["full_refresh"],
101+
"source_defined_cursor": false,
102+
"default_cursor_field": ["updated"]
103+
},
104+
"sync_mode": "full_refresh",
105+
"cursor_field": null,
106+
"destination_sync_mode": "overwrite"
107+
},
96108
{
97109
"stream": {
98110
"name": "owners",

airbyte-integrations/connectors/source-hubspot/source_hubspot/api.py

+12
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,18 @@ class FormStream(Stream):
650650
created_at_field = "createdAt"
651651

652652

653+
class MarketingEmailStream(Stream):
654+
"""Marketing Email, API v1
655+
Docs: https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-emails
656+
"""
657+
658+
url = "/marketing-emails/v1/emails/with-statistics"
659+
data_field = "objects"
660+
limit = 250
661+
updated_at_field = "updated"
662+
created_at_field = "created"
663+
664+
653665
class OwnerStream(Stream):
654666
"""Owners, API v3
655667
Docs: https://legacydocs.hubspot.com/docs/methods/owners/get_owners

airbyte-integrations/connectors/source-hubspot/source_hubspot/client.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
EmailEventStream,
1919
EngagementStream,
2020
FormStream,
21+
MarketingEmailStream,
2122
OwnerStream,
2223
SubscriptionChangeStream,
2324
WorkflowStream,
@@ -43,6 +44,7 @@ def __init__(self, start_date, credentials, **kwargs):
4344
"engagements": EngagementStream(**common_params),
4445
"forms": FormStream(**common_params),
4546
"line_items": CRMObjectStream(entity="line_item", **common_params),
47+
"marketing_emails": MarketingEmailStream(**common_params),
4648
"owners": OwnerStream(**common_params),
4749
"products": CRMObjectStream(entity="product", **common_params),
4850
"subscription_changes": SubscriptionChangeStream(**common_params),

0 commit comments

Comments
 (0)