Added the Recently Added Newsletter! You are welcome.

pull/2096/head
tidusjar 7 years ago
parent 1138f09286
commit 3124163f7c

@ -146,7 +146,7 @@ namespace Ombi.Store.Context
notificationToAdd = new NotificationTemplates
{
NotificationType = notificationType,
Message = "Hello! The user '{RequestedUser}' has requested the {Type} '{Title}'! Please log in to approve this request. Request Date: {RequestedDate}",
Message = "Hello! The user '{UserName}' has requested the {Type} '{Title}'! Please log in to approve this request. Request Date: {RequestedDate}",
Subject = "{ApplicationName}: New {Type} request for {Title}!",
Agent = agent,
Enabled = true,
@ -156,7 +156,7 @@ namespace Ombi.Store.Context
notificationToAdd = new NotificationTemplates
{
NotificationType = notificationType,
Message = "Hello! The user '{IssueUser}' has reported a new issue for the title {Title}! </br> {IssueCategory} - {IssueSubject} : {IssueDescription}",
Message = "Hello! The user '{UserName}' has reported a new issue for the title {Title}! </br> {IssueCategory} - {IssueSubject} : {IssueDescription}",
Subject = "{ApplicationName}: New issue for {Title}!",
Agent = agent,
Enabled = true,
@ -166,7 +166,7 @@ namespace Ombi.Store.Context
notificationToAdd = new NotificationTemplates
{
NotificationType = notificationType,
Message = "Hello! You requested {Title} on {ApplicationName}! This is now available! :)",
Message = "Hello! You {Title} on {ApplicationName}! This is now available! :)",
Subject = "{ApplicationName}: {Title} is now available!",
Agent = agent,
Enabled = true,
@ -210,7 +210,7 @@ namespace Ombi.Store.Context
notificationToAdd = new NotificationTemplates
{
NotificationType = notificationType,
Message = "Hello {IssueUser} Your issue for {Title} has now been resolved.",
Message = "Hello {UserName} Your issue for {Title} has now been resolved.",
Subject = "{ApplicationName}: Issue has been resolved for {Title}!",
Agent = agent,
Enabled = true,

@ -129,7 +129,6 @@ export class TvSearchComponent implements OnInit {
public getExtraInfo() {
this.tvResults.forEach((val, index) => {
this.imageService.getTvBanner(val.data.id).subscribe(x => {
val.data.background = this.sanitizer.

@ -38,4 +38,8 @@ export class JobService extends ServiceHelpers {
public runEmbyCacher(): Observable<boolean> {
return this.http.post<boolean>(`${this.url}embycontentcacher/`, {headers: this.headers});
}
public runNewsletter(): Observable<boolean> {
return this.http.post<boolean>(`${this.url}newsletter/`, {headers: this.headers});
}
}

@ -30,14 +30,18 @@
<button type="button" (click)="test()" class="btn btn-danger-outline">Test</button>
<button type="button" (click)="updateDatabase()" class="btn btn-info-outline" tooltipPosition="top" pTooltip="I recommend running this with a fresh Ombi install, this will set all the current *found* content to have been sent via Newsletter,
if you do not do this then everything that Ombi has found in your libraries will go out on the first email!">Update Database</button>
<button type="button" (click)="trigger()" class="btn btn-danger-outline">Trigger now</button>
</div>
<small>NOTE: Please see the tooltip on the Update Database button.</small>
<small>When testing, the test newsletter will go to all users that have the Admin role, please ensure that there are valid email addresses for this. The test will also only grab the latest 10 movies and 10 shows just to give you an example.</small>
</div>
</div>
</div>
<div class="col-md-6">
<small>NOTE: Please see the tooltip on the Update Database button - Please see the wiki for more information</small>
<br/>
<br/>
<small>When testing, the test newsletter will go to all users that have the Admin role, please ensure that there are valid email addresses for this. The test will also only grab the latest 10 movies and 10 shows just to give you an example.</small>
</div>
</fieldset>

@ -1,9 +1,9 @@

import { } from './../../services/job.service';
import { Component, OnInit } from "@angular/core";
import { INewsletterNotificationSettings, NotificationType } from "../../interfaces";
import { NotificationService } from "../../services";
import { SettingsService } from "../../services";
import { JobService, NotificationService, SettingsService } from "../../services";
import { TesterService } from "./../../services/applications/tester.service";
@Component({
@ -16,7 +16,8 @@ export class NewsletterComponent implements OnInit {
constructor(private settingsService: SettingsService,
private notificationService: NotificationService,
private testService: TesterService) { }
private testService: TesterService,
private jobService: JobService) { }
public ngOnInit() {
this.settingsService.getNewsletterSettings().subscribe(x => {
@ -26,10 +27,17 @@ export class NewsletterComponent implements OnInit {
public updateDatabase() {
this.settingsService.updateNewsletterDatabase().subscribe();
this.notificationService.success("Database updated");
}
public test() {
this.testService.newsletterTest(this.settings).subscribe();
this.notificationService.success("Test message queued");
}
public trigger() {
this.jobService.runNewsletter().subscribe();
this.notificationService.success("Triggered newsletter job");
}
public onSubmit() {

@ -20,7 +20,7 @@ namespace Ombi.Controllers
{
public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter,
ICacheService mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync,
IEmbyContentSync embyContentSync)
IEmbyContentSync embyContentSync, INewsletterJob newsletter)
{
_updater = updater;
_plexUserImporter = userImporter;
@ -28,6 +28,7 @@ namespace Ombi.Controllers
_memCache = mem;
_plexContentSync = plexContentSync;
_embyContentSync = embyContentSync;
_newsletterJob = newsletter;
}
private readonly IOmbiAutomaticUpdater _updater;
@ -36,6 +37,7 @@ namespace Ombi.Controllers
private readonly ICacheService _memCache;
private readonly IPlexContentSync _plexContentSync;
private readonly IEmbyContentSync _embyContentSync;
private readonly INewsletterJob _newsletterJob;
/// <summary>
/// Runs the update job
@ -129,5 +131,16 @@ namespace Ombi.Controllers
BackgroundJob.Enqueue(() => _embyContentSync.Start());
return true;
}
/// <summary>
/// Runs the newsletter
/// </summary>
/// <returns></returns>
[HttpPost("newsletter")]
public bool StartNewsletter()
{
BackgroundJob.Enqueue(() => _newsletterJob.Start());
return true;
}
}
}
Loading…
Cancel
Save