cancel
Showing results for 
Search instead for 
Did you mean: 

Add Google Font API In Magento 2 Admin Panel Email Templates

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Add Google Font API In Magento 2 Admin Panel Email Templates

I am working on editing email templates in the Magento 2 Admin Panel. I am trying to add Montserrat, a google font, to the email templates. Magento doesn't recognize the google font api and won't include the font.

 

I have tried adding the below code lines in the html file under the head tag but this provides me with a 404 error.

<link href="https://fonts.googleapis.com/css?family=Montserrat:400,800&display=swap" rel="stylesheet"> 

<link src="https://fonts.googleapis.com/css?family=Montserrat:400,800&display=swap" rel="stylesheet" src_type="url">

I have flushed the cache and still no luck. I've changed the text from a <p> tag to <span>, and still nothing. I also tried entering

@import url("https://fonts.googleapis.com/css?family=Montserrat:400,800&display=swap");

in the template styles section and this doesn't work.

Example code:

<p style="margin:0;padding:0;box-sizing:border-box;font-family:'Montserrat', sans-serif;"> Hello </p>

I expect the font to be Montserrat, but instead we get sans-serif. Any advice?