fix: remove 3rd party assets from mail (#3569)

This commit is contained in:
Livio Amstutz
2022-05-02 16:41:57 +02:00
committed by GitHub
parent 2e97394246
commit ef6fd5a843
11 changed files with 24 additions and 28 deletions

View File

@@ -15,8 +15,6 @@ func GetTemplateData(translator *i18n.Translator, translateArgs map[string]inter
PrimaryColor: templates.DefaultPrimaryColor,
BackgroundColor: templates.DefaultBackgroundColor,
FontColor: templates.DefaultFontColor,
LogoURL: templates.DefaultLogo,
FontURL: templates.DefaultFont,
FontFamily: templates.DefaultFontFamily,
IncludeFooter: false,
}
@@ -33,14 +31,14 @@ func GetTemplateData(translator *i18n.Translator, translateArgs map[string]inter
if assetsPrefix == "" {
return templateData
}
templateData.LogoURL = ""
if policy.Light.LogoURL != "" {
templateData.LogoURL = fmt.Sprintf("%s/%s/%s", assetsPrefix, policy.ID, policy.Light.LogoURL)
}
if policy.FontURL != "" {
split := strings.Split(policy.FontURL, "/")
templateData.FontFamily = split[len(split)-1] + "," + templates.DefaultFontFamily
templateData.FontFaceFamily = split[len(split)-1]
templateData.FontURL = fmt.Sprintf("%s/%s/%s", assetsPrefix, policy.ID, policy.FontURL)
templateData.FontFamily = templateData.FontFaceFamily + "," + templates.DefaultFontFamily
}
return templateData
}