Skip to main content
Solved

Using the Content API to update HTML, makes the preview not being newly generated


Forum|alt.badge.img

I am trying to figure out the following problem:
- I have created a HTML-Template via API which is a code-only template ( stored the reference ID )
- Now I update the contents of it with freshly generated html via API( working fine )
- Finally I am going to check if the preview is loaded correctly and check the results with a testing profile. Right here I am stuck. There’s no preview generated anymore, if I selected a profile which includes the necessary properties for testing I also don’t get a preview. It just shows me a white page.

Fun fact, if I save the template via editor once without changing the code, the preview is then working perfectly again.

 

Is anyone able to provide me a solution?

Thanks in Advance!

Best answer by jhorngacher

Hi ​@emma.owens!
Exactly, I’ve already found the issue. I forgot to have enclosing <html>and <body>  tags. 
So for anyone having the same struggle put inside the payload of the html-content a starting <html> and <body> tag and u’re good-to-go

<html>
      <body>
             your additonal code goes here 
      </body>
</html>

 

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

emma.owens
Community Manager
Forum|alt.badge.img+17
  • Community Manager
  • 135 replies
  • March 26, 2025

Hi ​@jhorngacher ! Thank you for reaching out to Community, and sorry to hear you’re having issues previewing your HTML email template. 

To clarify, when you preview the email in Klaviyo is it just showing as a blank screen? And then once you save the template and go back to preview, it then shows? 


Forum|alt.badge.img
  • Author
  • Problem Solver I
  • 4 replies
  • Answer
  • March 31, 2025

Hi ​@emma.owens!
Exactly, I’ve already found the issue. I forgot to have enclosing <html>and <body>  tags. 
So for anyone having the same struggle put inside the payload of the html-content a starting <html> and <body> tag and u’re good-to-go

<html>
      <body>
             your additonal code goes here 
      </body>
</html>