fix: removed the unsub link when not present

This commit is contained in:
tidusjar 2022-01-31 20:08:39 +00:00
commit 815688823e
2 changed files with 3 additions and 1 deletions

View file

@ -30,6 +30,7 @@ namespace Ombi.Notifications.Templates
private const string TableLocation = "{@RECENTLYADDED}"; private const string TableLocation = "{@RECENTLYADDED}";
private const string IntroText = "{@INTRO}"; private const string IntroText = "{@INTRO}";
private const string Unsubscribe = "{@UNSUBSCRIBE}"; private const string Unsubscribe = "{@UNSUBSCRIBE}";
private const string UnsubscribeText = "{@UNSUBSCRIBETEXT}";
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)
@ -41,6 +42,7 @@ namespace Ombi.Notifications.Templates
sb.Replace(DateKey, DateTime.Now.ToString("f")); sb.Replace(DateKey, DateTime.Now.ToString("f"));
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 : "Unsubscrible");
return sb.ToString(); return sb.ToString();
} }

View file

@ -453,7 +453,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="content-block powered-by" valign="top" align="center" style="font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; color: #999999; font-size: 12px; text-align: center;"> <td class="content-block powered-by" valign="top" align="center" style="font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; color: #999999; font-size: 12px; text-align: center;">
<a href="{@UNSUBSCRIBE}" style="font-weight: 400; font-size: 12px; text-align: center; color: #ff761b;">Unsubscribe</a> <a href="{@UNSUBSCRIBE}" style="font-weight: 400; font-size: 12px; text-align: center; color: #ff761b;">{@UNSUBSCRIBETEXT}</a>
</td> </td>
</tr> </tr>
<tr> <tr>