diff --git a/Ombi.Services/Jobs/RecentlyAdded.cs b/Ombi.Services/Jobs/RecentlyAdded.cs index 8ac7b6743..563dd35a5 100644 --- a/Ombi.Services/Jobs/RecentlyAdded.cs +++ b/Ombi.Services/Jobs/RecentlyAdded.cs @@ -200,16 +200,17 @@ namespace Ombi.Services.Jobs html = template.LoadTemplate(sb.ToString()); Log.Debug("Loaded the template"); } - - Send(newletterSettings, html, plexSettings, testEmail); + string escapedHtml = new string(html.Where(c => !char.IsControl(c)).ToArray()); + Log.Debug(escapedHtml); + Send(newletterSettings, escapedHtml, plexSettings, testEmail); } private void GenerateMovieHtml(List movies, PlexSettings plexSettings, StringBuilder sb) { var orderedMovies = movies.OrderByDescending(x => x?.addedAt.UnixTimeStampToDateTime()).ToList() ?? new List(); - sb.Append("

New Movies:



"); + sb.Append("

New Movies:



"); sb.Append( ""); foreach (var movie in orderedMovies) @@ -259,13 +260,13 @@ namespace Ombi.Services.Jobs } } - sb.Append("


"); + sb.Append("

"); } private void GenerateMovieHtml(List movies, PlexSettings plexSettings, StringBuilder sb) { var orderedMovies = movies.OrderByDescending(x => x?.addedAt.UnixTimeStampToDateTime()).ToList() ?? new List(); - sb.Append("

New Movies:



"); + sb.Append("

New Movies:



"); sb.Append( ""); foreach (var movie in orderedMovies) @@ -315,14 +316,14 @@ namespace Ombi.Services.Jobs } } - sb.Append("


"); + sb.Append("

"); } private void GenerateTvHtml(List tv, PlexSettings plexSettings, StringBuilder sb) { var orderedTv = tv.OrderByDescending(x => x?.addedAt.UnixTimeStampToDateTime()).ToList(); // TV - sb.Append("

New Episodes:



"); + sb.Append("

New Episodes:



"); sb.Append( ""); foreach (var t in orderedTv) @@ -375,14 +376,14 @@ namespace Ombi.Services.Jobs EndLoopHtml(sb); } } - sb.Append("


"); + sb.Append("

"); } private void GenerateTvHtml(List tv, PlexSettings plexSettings, StringBuilder sb) { var orderedTv = tv.OrderByDescending(x => x?.addedAt.UnixTimeStampToDateTime()).ToList(); // TV - sb.Append("

New Episodes:



"); + sb.Append("

New Episodes:



"); sb.Append( ""); foreach (var t in orderedTv) @@ -435,7 +436,7 @@ namespace Ombi.Services.Jobs EndLoopHtml(sb); } } - sb.Append("


"); + sb.Append("

"); } private void Send(NewletterSettings newletterSettings, string html, PlexSettings plexSettings, bool testEmail = false) @@ -516,10 +517,12 @@ namespace Ombi.Services.Jobs private void EndLoopHtml(StringBuilder sb) { + //NOTE: BR have to be in TD's as per html spec or it will be put outside of the table... + //Source: http://stackoverflow.com/questions/6588638/phantom-br-tag-rendered-by-browsers-prior-to-table-tag + sb.Append("
"); + sb.Append("
"); + sb.Append("
"); sb.Append(""); - sb.Append("
"); - sb.Append("
"); - sb.Append("
"); sb.Append(""); } diff --git a/Ombi.Services/Jobs/Templates/RecentlyAddedTemplate.html b/Ombi.Services/Jobs/Templates/RecentlyAddedTemplate.html index 2229df38c..f5b208138 100644 --- a/Ombi.Services/Jobs/Templates/RecentlyAddedTemplate.html +++ b/Ombi.Services/Jobs/Templates/RecentlyAddedTemplate.html @@ -149,8 +149,8 @@ -
-
+
+

Here is a list of Movies and TV Shows that have recently been added to Plex!