From e473a8d3205c8be0856b49dd37cd70d617e4955b Mon Sep 17 00:00:00 2001 From: Louis Laureys Date: Tue, 16 Jan 2018 15:40:26 +0100 Subject: [PATCH] E-Mails: Only add poster table row if img is set (#1899) --- src/Ombi.Notifications.Templates/EmailBasicTemplate.cs | 6 +++--- .../Templates/BasicTemplate.html | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Ombi.Notifications.Templates/EmailBasicTemplate.cs b/src/Ombi.Notifications.Templates/EmailBasicTemplate.cs index 64740fb43..4814945e7 100644 --- a/src/Ombi.Notifications.Templates/EmailBasicTemplate.cs +++ b/src/Ombi.Notifications.Templates/EmailBasicTemplate.cs @@ -20,17 +20,17 @@ namespace Ombi.Notifications.Templates private const string SubjectKey = "{@SUBJECT}"; private const string BodyKey = "{@BODY}"; - private const string ImgSrc = "{@IMGSRC}"; + private const string Poster = "{@POSTER}"; private const string DateKey = "{@DATENOW}"; private const string Logo = "{@LOGO}"; - public string LoadTemplate(string subject, string body, string img = default(string), string logo = default(string)) + public string LoadTemplate(string subject, string body, string imgsrc = default(string), string logo = default(string)) { var sb = new StringBuilder(File.ReadAllText(TemplateLocation)); sb.Replace(SubjectKey, subject); sb.Replace(BodyKey, body); sb.Replace(DateKey, DateTime.Now.ToString("f")); - sb.Replace(ImgSrc, string.IsNullOrEmpty(img) ? string.Empty : img); + sb.Replace(Poster, string.IsNullOrEmpty(imgsrc) ? string.Empty : $"\"Poster\""); sb.Replace(Logo, string.IsNullOrEmpty(logo) ? "http://i.imgur.com/qQsN78U.png" : logo); return sb.ToString(); diff --git a/src/Ombi.Notifications.Templates/Templates/BasicTemplate.html b/src/Ombi.Notifications.Templates/Templates/BasicTemplate.html index 8482b6b40..ac4c4a119 100644 --- a/src/Ombi.Notifications.Templates/Templates/BasicTemplate.html +++ b/src/Ombi.Notifications.Templates/Templates/BasicTemplate.html @@ -144,7 +144,7 @@ @@ -153,11 +153,7 @@ - - - + {@POSTER}
- Ombi logo + Ombi logo
- Poster -