How do we check that the 'view in browser' code works for emails?

I have taken the code snippet from Hubspots templates and added it to our custom header module.
The code is as follows:

<p style="font-family:'Graphik bold', arial, 'San Francisco', helvetica, sans-serif; font-size:15px; line-height:1.3em; color:#1fb6ff; text-align:right; font-weight:bold; text-decoration:none; Margin:0 0 0 20px; padding:0; mso-line-rule:exactly;"><a class="hubspot-mergetag" data-viewaswebpage="true" href="" style="color:#1fb6ff; text-decoration: none; font-weight:bold; line-height: 1.3em;" target="_blank">{{ module.text_field }}</a></p>

Can anyone confirm if im along the right lines with this? How would I test that this works?
Thanks in advance for the help!

@Rachel-Marvel - Here’s the code we use when belch.io email templates are created (this is the HUBL output).

The first “if” statement checks to make sure the marketer setting up or creating the email has enabled the “view as webpage” toggle and the “view_as_page_url” is the link to the email’s web page version:

 {% if content.create_page %}
 <div>
 Not rendering correctly? View this email as a web page <a class="hubspot-mergetag" data-viewaswebpage="true" href="{{ view_as_page_url }}">here</a>.
 </div>
 {% endif %}

If this answer helped, please, mark as solved :grinning_face_with_smiling_eyes:


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me on slack.

Thank you - once I enabled ‘view as webpage’ on the email - it worked :slightly_smiling_face:

Thank you! This is just what I was looking for -- to add to my coded HS email.