Hello everyone,
i'm trying send a custom email template, with new fonts and styles included.
In the backend, the emails are displayed properly since i added a CSS in the backend assets. But of course, when the email is sent, the css file is not, resulting in a broken email.
I then included a <style> tag in the template so i can easily include the needed css class declaration.
But i don't know how i can add a link to the fonts for them to be used in the email.
in my CSS file i have:
@font-face {
font-family: AlternateGothicNo2BT-Regular;
src: url('../../../../my_module/static/src/fonts/AlternateGothicNo2BT-Regular.otf') format('opentype');
font-style: normal;
}
and tried to do the same in the email but, of course, it does work since its a relative path.
I tried to encode the font in b64 and sent them in the email, but then the message get cropped in gmail, for example (with a link to "open full message", which is of course not acceptable.
@font-face {
font-family: AlternateGothicNo2BT-Regular;
src: url(data:font/opentype;charset=utf-8;base64,[b64 encoded font]) format("otf"),
font-style: normal;
}
Is there a way to avoid having to add an hard path in the style tag?
Thanks :)