Looking for Email Preview Url or Content HTML

As part of my product’s marketing integration, we display the content of marketing emails sent out to contacts. I found the email api endpoint that returns a list of widgets as well as the layout of the widgets in the email, however Im not trying to build a custom renderer based on these objects. Is there a way to get the html (or even a url) from the preview screen on the portal?

Thank you,

Josh

Hi @WPSupport

To be honest, I am not 100% following the question :grimacing:. And there is a good chance that this is me on a Friday with a fried brain. Could you ellaborate?

Because there is a large possibility that it is just me being fried, will add a few people to the thread in hopes that they are better off :grinning_face:

@quentin_lamamy , @lynton if you all feel like saving me, go for it :+1:

Hey Dennis, I completely relate to the Friday afternoon feeling :grin:.

To elaborate on my situation: I have a CRM product that directly integrates with the Hubspot API by pushing contacts, maintaining list membership, and tracking email history. As part of my product, we show a list of emails that have been sent to an associated contact. For other marketing platforms that we integrate with, I am able to get either a link or the html for each email that was sent so that I can display at least a preview of the message. I’m trying to re-create this functionality for our Hubspot subscribers.

I have found two things so far. The first is the email api endpoint (GET /marketing-emails/v1/emails/:id). I could not find a valid url or html blob that I could use in the response object. What I did find were the widget and layout objects, however, I would have to build a custom renderer to be able to recreate what an email actually looks like from this information. The second thing I found was the ‘preview’ feature that exists within the Hubspot website when viewing an email as an administrator. The external url looks something like this: 'https://preview.hs-sites.com/_hcms/preview/content/42514309390?portalId=9481732&_preview=true&cacheBust=0&preview_key=HbmJBnAP&from_buffer=false’ however I believe the preview_key is generated on the server so its not possible for me to create this url by hand.

Just looking for some guidance on how to show a preview of emails that are being sent.

Thank you for your help and happy Friday!

Josh

Hi for those still searching it looks like this is available in the the legacy API. https://legacydocs.hubspot.com/docs/methods/lists/marketing-email-overview

There is a field called “previewKey” that could be used to build the external URL like
https://YOUR_PORTAL_ID.hubspotpreview-na1.com/_hcms/preview/email/EMAIL_ID?portalId=YOUR_PORTAL_ID&preview_key=previewKey&_preview=true&from_buffer=false&cacheBust=0&hsPreviewerApp=email

I just was searching for the same thing and saw this unanswered post. Any update to the answer to the question?