更改系统发送的所有电子邮件的默认字体类型

Hi!

I am trying to modify the invites email a new user will receive whe we send him and invitation. I am trying to meet the design needs of our company(fonts, colors,…) The fonts we need are in Google fonts site and i try to modify the HTML Template in which all html emails are rendered trying to add two font types i need to use…

<head>
  <meta http-equiv="Content-type" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
  <title></title>
  <link href="https://fonts.googleapis.com/css?family=Montserrat:700|Source+Sans+Pro:300&amp;display=swap" rel="stylesheet" type='text/css'>
</head>

…then in the body of template i add:

<style type="text/css">    
 body, p {font-family: 'Source Sans Pro', sans-serif;}
</style>
<!--[endif]-->

%{email_content}

…but when i receive test invite emails to a temporary address i’ve setup to test if this is working or not…the only font wich is loaded is the fallback font wich is “sans-serif”. The font i need is not downloaded or parsed.

So how can i customize invite email using fonts from Google fonts…??

And second part of my request is how can i add for example an outlined div or paragraph to only one email template(invite email template) because BBCodes doesn’t allow to customize a lot.

Thanks in advance!!

Your markup looks correct. What email client are you testing this on? Not all email clients support the use of web fonts. I don’t think Gmail supports web fonts.

Try adding a div with the class you are wanting to style directly to the invite template and then adding styles to the class to the Email Style / CSS editor. Discourse will substitute the styles you add there directly into the div that you target with a class. For example, with the Invite Mailer template customized to:

<div class="invite">
%{inviter_name} invited you to a discussion

> **%{topic_title}**
>
> %{topic_excerpt}

at

> %{site_title} -- %{site_description}

If you're interested, click the link below:

%{invite_link}
</div>

and the following added to Email Styles / CSS

.invite {
    border: 1px solid red;
}

Invites have a red border around the content.

Thanks i will try and will let you know…I am using GMX services to test invite emails… maybe is what you are saying…i will test with other email client.

那么,在 Gmail 中更改邮件字体是否可行?目前我尚未成功在我们的邮件中添加波斯语字体。有什么办法吗?

我这周将进行一些邮件测试。我会看看能否弄清楚如何实现这一点。如果任何人知道如何添加自定义字体以便它们在 Gmail 中生效,请告诉我。

你试过在 Google 上搜索答案吗?

我明白你的意思。我尝试过搜索(用谷歌)如何更改摘要邮件的字体,无论是在谷歌还是 Meta 中。

这就是为什么我没有创建新话题,而是直接在搜索到的话题末尾回复!;)

我还没试过查看 Gmail 是否支持不同字体,因为我在 Gmail 收件箱里看到过其他网站发来的邮件,它们使用了波斯语字体。