Resubscribe to Email Subscription using API


#1

Hi All,

I am trying to update the user subscription status using the Email API. It works well when I need to unsubscribe an email address for a subscription. However, Is there a way to resubscribe email subscriptions? Looks like the Email API only allows you to unsubscribe an email. Any help in this is much appreciated.

Thanks,
Santy


Unsubscribe contact from Contacts endpoint?
#2

Hi @santy

As mentioned on the documentation page, the Email API can only be used to unsubscribe a contact. The API cannot be used to resubscribe a contact, so the contact would need to use the email preferences link in a previous email to resubscribe themselves.


#3

Hi @dadams!

Thanks for the quick response. We have a custom portal which we want to allow the logged in user to Subscribe/Unsubscribe to email subscriptions. Is there any workaround to use the API to resubscribe without asking the user to use the email preferences link from the old emails?

Thanks,
Santy


#4

Hi @santy,

HubSpot imposes rigid restrictions on manipulating the global unsubscribe, as it is used to ensure compliance with CAN-SPAM and other global regulatory requirements. Consequently, the global unsubscribe (hs_email_optout) should not be used to manage subscription preferences. The following solutions should be considered instead:

  • Email Types. These are how HubSpot’s own built-in subscription management page keep track of different subscription options. You can set these up from Content Settings > Email > Email Types. Each email type gets an associated contact property to track the opt out on that type (where lack of an opt out implies a subscription). These contact properties are internally named e.g. hs_email_optout_###### where the number signs indicate an identifier for the email type. Using the Contact Settings page (look up “Opted out” on the properties list), you can find out what the identifier is for each of your email types. You should be able to access and modify these properties via API, and they do not have the same limitations as the global unsubscribe. When using Email Types, be sure that every marketing email you send out has a correctly configured Email Type to correspond with the subscription that the email relates to.
  • Custom Properties. You can create a custom property to track subscriptions, and update that property via API to indicate a customer’s preference. Like Email Types, the custom property is not subject to any of the limitations of the global unsubscribe property. Use your custom property to create a Smart List of everybody who is not subscribed, and use that Smart List as a suppression list in your marketing emails.

Connecting Notification Settings from webapp to hubspot
#5

Thanks for the details @Bistream630 !


#7

The Email Types solution provided is not possible in the tool. Please reference https://developers.hubspot.com/docs/methods/email/update_status - “It is only possible to opt email addresses OUT of subscription and there is NO UNDO for this operation.”

This includes managing subscriptions to email types - if a contact has opted out of all marketing email, you could theoretically resubscribe them to all of your email types, overriding the global opt-out.

Custom Properties workaround is possible. Thank you, @Bistream630


#8

Is jessie correct? Is is not possible to re-subscribe to email types via the API?
I don't mean the full opt out. Just other types


#9

I don't understand why subscribing isn't possible via the API.
The built in Pref page allows this on email types. Why is using the API different?
I want to write our own Pref's page but this isn't going to be worthwhile due to this restriction


#10

Hi @StuGreen,

The default HubSpot subscription properties are read-only; this is to maintain subscription preference integrity among all HubSpot contacts. Allowing write access to the subscription preference properties opens up the possibility of abuse (e.g. an integration that opts-in all your opted-out contacts against their wishes). You can still customize your email subscription page; check out the following Knowledge Base article:


#11

Hi, just checking in to see if there are any updates on this topic. I understand that it's not possible to opt an email address back in to a subscription type once they've opted out, but to me it doesn't make sense that we can't provide users the possibility to edit these settings unless they go through a previous email (or resubscription email), Can't we at least generate a link to the subscription preferences page? Is this something you will solve for in the near future?


#13

Hey @shamash,

It's possible to populate a link to a contact's subscription preferences page with the {{ unsubscribe_link }} HubL variable documented here, but these tokens cannot be used on web pages. Additionally, the page the contact goes to can't be hyperlinked to.

That said, this endpoint gives you the flexibility to create your own form or subscription preference page. When the contact submits the form or takes an action, you can call the endpoint and update their HubSpot subscriptions accordingly. In this way, you're not beholden to the default subscription preferences pages accessible via the HubL variable or a previous email.


#14

Yes, well... using that endpoint we can set up our own subscription page. BUT, if a contact opts out of any email they can’t opt back in, rendering our custom made subscription preference page useless, compared to HubSpot’s default subscription page where you actually can change your settings. Or am I misunderstanding something here?

—Shamash


#15

Good point, @shamash. You're not misunderstanding anything; at this time, HubSpot generates a contact’s subscription preferences page via email identity tracking.

I have heard this request before, though, and I would personally like to see more flexibility regarding contacts' subscription preferences. Could you upvote and comment on this HubSpot Community feature request to help it become a reality? I've already upvoted it and will pass the feedback along internally as well.