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);// RESPONSEarray: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”?