APIs & Integrations

smj-php
参加者

Default Marketing Subscription Status When Creating Contacts

Hi,

 

I've inherited a system whereby when a contact is created via the Contacts API, it appears as though a "newsletter" subscription is automatically generated for them. I believe the "newsletter" subscription is setup by a HubSpot admin user (someone in markteing).

 

What confuses me is the response i recieve from the Marketing API communication preferences endpoint, when called immediately after creating a new contact via the Contacts API.

 

// REQUEST
$hubSpot
->communicationPreferences()
->statusApi()
->getEmailStatus($email);


// RESPONSE
array:2
[ 0 => HubSpot\Client\CommunicationPreferences\Model\PublicSubscriptionStatus { #container: array:9 [ "id" => "1234567891" "name" => "Newsletter" "description" => "Users registered in the website will receive emails and notifications as part of the newsletter" "status" => "SUBSCRIBED" "source_of_status" => "SUBSCRIPTION_STATUS" "brand_id" => null "preference_group_name" => null "legal_basis" => null "legal_basis_explanation" => null ] } 1 => HubSpot\Client\CommunicationPreferences\Model\PublicSubscriptionStatus { #container: array:9 [ "id" => "1234567890" "name" => "One to One" "description" => "One to One emails" "status" => "SUBSCRIBED" "source_of_status" => "SUBSCRIPTION_STATUS" "brand_id" => null "preference_group_name" => null "legal_basis" => null "legal_basis_explanation" => null ] } 

Judging from the "status" value, it appears as though the User, after being created, is automatically opted in for the newsletter, without ever giving permission to be opted in.

 

I also see the same thing happening in the developer endpoints after creating new Contacts.

 

Can someone tell me how I am mis-interpreting the response from the communication preferences endpoint? What key actually signifies a user is "subscribed"?

0 いいね!
2件の返信
Jaycee_Lewis
コミュニティーマネージャー
コミュニティーマネージャー

Default Marketing Subscription Status When Creating Contacts

Hey, @smj-php 👋 Check out my reply here — Potential bug when checking subscription status. The short answer is you are getting the expected result. 

 

In this case, there is not a specific single developer document that explains this behaviour. I cobbled together my above reply from several internal resources.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

smj-php
参加者

Default Marketing Subscription Status When Creating Contacts

Thank you for the info @Jaycee_Lewis . Is the post you're linking to suggesting contacts are opted in without consent? If so, what is the best practice for ensuring we aren't sending emails to customers who haven't actually opted in? Populating "legal_basis" when we have the opt in permission from the customer?

 

Do you mind providing some info on GDPR and NON-GDPR portals? While I am developing for integration with a GDPR application, I am certain Sales are also using hubspot as a leads/contact management system.

0 いいね!