Please note: a Marketing HubProfessional or Enterprise account is required to build custom coded email templates.
Create a new HTML & HubL file
In your HubSpot account, navigate to Marketing > Files and Templates > Design Tools.
In the left sidebar, create a new file by clickingFile>New file. You may need to click thefolder folder icon to expand the finder.
In the dialog box, click the What would you like to build today? dropdown menu and select HTML & HUBL.
Enter the details of your new file:
Select Template or Template Partial. A template partial is a template that can be used within other templates.
In the dropdown menu, select the type of template you're coding (page, blog, or email).
Give your file a name.
To update the file's location, in the File location section, click Change and select the folder to add the file to.
Write the HTML for your page or email template.
To preview how your HubL will render, click to toggle the Show output switch on. A panel will open on the right with the rendered preview.
In the upper right, click Preview to preview how your template will appear and function in the content editor. This preview syncs with the editor and will automatically refresh as you work.
In the upper right, click Publish changes
Any errors in your code will be flagged in an error message when you try to publish changes. The error console at the bottom of the code editor will display the error or warning details, as well as suggestions on how you can fix these errors and warnings.