0

I am using "Olegnax Athlete2" theme for my magento2.4.5-p2 store. I want to change my email template fonts to "futura pt book". can someone guide me to do the same.

1 Answer 1

0

Go to the Magento Admin Panel.

Click on "Marketing" and select "Email Templates" from the dropdown menu.

Locate the email template that you want to edit and click on the "Edit" button on the right-hand side.

In the email template editor, locate the HTML body tag.

Add a style attribute to the body tag and set the font-family property to "Futura PT Book".

Like this,

<body style="font-family: 'Futura PT Book', Arial, sans-serif;">

And Just Save.

If the above method didn't work Try this,

Create a folder called "fonts" in your theme's web directory.

Upload your custom font files (e.g. FuturaPTBook.ttf, FuturaPTBook.woff, etc.) to the "fonts" folder.

Add the font files to your theme's web-fonts.xml file

Like this,

<font-family>FuturaPTBook</font-family>
    <src>
        <url path="fonts/FuturaPTBook.ttf"/>
        <url path=" fonts/FuturaPTBook.woff"/>
        <url path="fonts/FuturaPTBook.woff2"/>
    </src> </font>

In your email template's header template, add the following code to the style tag

@font-face {
    font-family: 'FuturaPTBook';
    src: url('{{view url="fonts/FuturaPTBook.ttf"}}') format('truetype'),
         url('{{view url="fonts/FuturaPTBook.woff"}}') format('woff'),
         url('{{view url="fonts/FuturaPTBook.woff2"}}') format('woff2');
    font-weight: normal;
    font-style: normal;
}

In your email template's style tag, add the following code to use the custom font

body {
    font-family: 'FuturaPTBook', Arial, sans-serif;
}
6
  • I added the style tag in the header template so that each and every email template must have the 'Futura PT Book' font. But now the font is changed to "Arial" not into "Futura PT Book", i think somehow it is not been able to include the font. please guide for the solution Commented May 1, 2023 at 5:51
  • Check My updated answer.
    – Harun
    Commented May 2, 2023 at 4:47
  • i have tried the updated answer too. when i inspect my mail it shows "Futura PT Book" but in actual the font is "Google Sans". Commented May 2, 2023 at 7:33
  • It's possible that the email client being used by your recipients does not support the "Futura PT Book" font and is therefore defaulting to a different font such as "Google Sans".
    – Harun
    Commented May 2, 2023 at 12:43
  • yes it is to "Serif" sometimes, i tried overriding it from header template and gave "futura pt book" and arial from body tag itself. but "futura pt book" is not implemented but arial is perfectly fine. Commented May 4, 2023 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.