mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Update NewsletterTemplate.cs
Add ApplicationUrl
This commit is contained in:
parent
14daa70fe9
commit
10033496e7
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Ombi.I18n.Resources;
|
using Ombi.I18n.Resources;
|
||||||
|
@ -27,6 +27,7 @@ namespace Ombi.Notifications.Templates
|
||||||
|
|
||||||
private const string SubjectKey = "{@SUBJECT}";
|
private const string SubjectKey = "{@SUBJECT}";
|
||||||
private const string DateKey = "{@DATENOW}";
|
private const string DateKey = "{@DATENOW}";
|
||||||
|
private const string AppUrl = "{@APPURL}";
|
||||||
private const string Logo = "{@LOGO}";
|
private const string Logo = "{@LOGO}";
|
||||||
private const string TableLocation = "{@RECENTLYADDED}";
|
private const string TableLocation = "{@RECENTLYADDED}";
|
||||||
private const string IntroText = "{@INTRO}";
|
private const string IntroText = "{@INTRO}";
|
||||||
|
@ -35,13 +36,14 @@ namespace Ombi.Notifications.Templates
|
||||||
private const string PoweredByText = "{@POWEREDBYTEXT}";
|
private const string PoweredByText = "{@POWEREDBYTEXT}";
|
||||||
|
|
||||||
|
|
||||||
public string LoadTemplate(string subject, string intro, string tableHtml, string logo, string unsubscribeLink)
|
public string LoadTemplate(string subject, string intro, string tableHtml, string logo, string unsubscribeLink, string applicationUrl)
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder(File.ReadAllText(TemplateLocation));
|
var sb = new StringBuilder(File.ReadAllText(TemplateLocation));
|
||||||
sb.Replace(SubjectKey, subject);
|
sb.Replace(SubjectKey, subject);
|
||||||
sb.Replace(TableLocation, tableHtml);
|
sb.Replace(TableLocation, tableHtml);
|
||||||
sb.Replace(IntroText, intro);
|
sb.Replace(IntroText, intro);
|
||||||
sb.Replace(DateKey, DateTime.Now.ToString("f"));
|
sb.Replace(DateKey, DateTime.Now.ToString("f"));
|
||||||
|
sb.Replace(AppUrl, applicationUrl);
|
||||||
sb.Replace(Logo, string.IsNullOrEmpty(logo) ? OmbiLogo : logo);
|
sb.Replace(Logo, string.IsNullOrEmpty(logo) ? OmbiLogo : logo);
|
||||||
sb.Replace(Unsubscribe, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : unsubscribeLink);
|
sb.Replace(Unsubscribe, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : unsubscribeLink);
|
||||||
sb.Replace(UnsubscribeText, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : Texts.Unsubscribe);
|
sb.Replace(UnsubscribeText, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : Texts.Unsubscribe);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue