mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added the Recently Added Newsletter! You are welcome.
This commit is contained in:
parent
1138f09286
commit
3124163f7c
6 changed files with 41 additions and 13 deletions
|
@ -146,7 +146,7 @@ namespace Ombi.Store.Context
|
||||||
notificationToAdd = new NotificationTemplates
|
notificationToAdd = new NotificationTemplates
|
||||||
{
|
{
|
||||||
NotificationType = notificationType,
|
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}!",
|
Subject = "{ApplicationName}: New {Type} request for {Title}!",
|
||||||
Agent = agent,
|
Agent = agent,
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
|
@ -156,7 +156,7 @@ namespace Ombi.Store.Context
|
||||||
notificationToAdd = new NotificationTemplates
|
notificationToAdd = new NotificationTemplates
|
||||||
{
|
{
|
||||||
NotificationType = notificationType,
|
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}!",
|
Subject = "{ApplicationName}: New issue for {Title}!",
|
||||||
Agent = agent,
|
Agent = agent,
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
|
@ -166,7 +166,7 @@ namespace Ombi.Store.Context
|
||||||
notificationToAdd = new NotificationTemplates
|
notificationToAdd = new NotificationTemplates
|
||||||
{
|
{
|
||||||
NotificationType = notificationType,
|
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!",
|
Subject = "{ApplicationName}: {Title} is now available!",
|
||||||
Agent = agent,
|
Agent = agent,
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
|
@ -210,7 +210,7 @@ namespace Ombi.Store.Context
|
||||||
notificationToAdd = new NotificationTemplates
|
notificationToAdd = new NotificationTemplates
|
||||||
{
|
{
|
||||||
NotificationType = notificationType,
|
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}!",
|
Subject = "{ApplicationName}: Issue has been resolved for {Title}!",
|
||||||
Agent = agent,
|
Agent = agent,
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
|
|
|
@ -129,7 +129,6 @@ export class TvSearchComponent implements OnInit {
|
||||||
|
|
||||||
public getExtraInfo() {
|
public getExtraInfo() {
|
||||||
this.tvResults.forEach((val, index) => {
|
this.tvResults.forEach((val, index) => {
|
||||||
|
|
||||||
this.imageService.getTvBanner(val.data.id).subscribe(x => {
|
this.imageService.getTvBanner(val.data.id).subscribe(x => {
|
||||||
|
|
||||||
val.data.background = this.sanitizer.
|
val.data.background = this.sanitizer.
|
||||||
|
|
|
@ -38,4 +38,8 @@ export class JobService extends ServiceHelpers {
|
||||||
public runEmbyCacher(): Observable<boolean> {
|
public runEmbyCacher(): Observable<boolean> {
|
||||||
return this.http.post<boolean>(`${this.url}embycontentcacher/`, {headers: this.headers});
|
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)="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,
|
<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>
|
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>
|
</div>
|
||||||
<small>NOTE: Please see the tooltip on the Update Database button.</small>
|
</div>
|
||||||
<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">
|
<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>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import { } from './../../services/job.service';
|
||||||
|
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { INewsletterNotificationSettings, NotificationType } from "../../interfaces";
|
import { INewsletterNotificationSettings, NotificationType } from "../../interfaces";
|
||||||
import { NotificationService } from "../../services";
|
import { JobService, NotificationService, SettingsService } from "../../services";
|
||||||
import { SettingsService } from "../../services";
|
|
||||||
import { TesterService } from "./../../services/applications/tester.service";
|
import { TesterService } from "./../../services/applications/tester.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -16,7 +16,8 @@ export class NewsletterComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private settingsService: SettingsService,
|
constructor(private settingsService: SettingsService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private testService: TesterService) { }
|
private testService: TesterService,
|
||||||
|
private jobService: JobService) { }
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.settingsService.getNewsletterSettings().subscribe(x => {
|
this.settingsService.getNewsletterSettings().subscribe(x => {
|
||||||
|
@ -26,10 +27,17 @@ export class NewsletterComponent implements OnInit {
|
||||||
|
|
||||||
public updateDatabase() {
|
public updateDatabase() {
|
||||||
this.settingsService.updateNewsletterDatabase().subscribe();
|
this.settingsService.updateNewsletterDatabase().subscribe();
|
||||||
|
this.notificationService.success("Database updated");
|
||||||
}
|
}
|
||||||
|
|
||||||
public test() {
|
public test() {
|
||||||
this.testService.newsletterTest(this.settings).subscribe();
|
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() {
|
public onSubmit() {
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter,
|
public JobController(IOmbiAutomaticUpdater updater, IPlexUserImporter userImporter,
|
||||||
ICacheService mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync,
|
ICacheService mem, IEmbyUserImporter embyImporter, IPlexContentSync plexContentSync,
|
||||||
IEmbyContentSync embyContentSync)
|
IEmbyContentSync embyContentSync, INewsletterJob newsletter)
|
||||||
{
|
{
|
||||||
_updater = updater;
|
_updater = updater;
|
||||||
_plexUserImporter = userImporter;
|
_plexUserImporter = userImporter;
|
||||||
|
@ -28,6 +28,7 @@ namespace Ombi.Controllers
|
||||||
_memCache = mem;
|
_memCache = mem;
|
||||||
_plexContentSync = plexContentSync;
|
_plexContentSync = plexContentSync;
|
||||||
_embyContentSync = embyContentSync;
|
_embyContentSync = embyContentSync;
|
||||||
|
_newsletterJob = newsletter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly IOmbiAutomaticUpdater _updater;
|
private readonly IOmbiAutomaticUpdater _updater;
|
||||||
|
@ -36,6 +37,7 @@ namespace Ombi.Controllers
|
||||||
private readonly ICacheService _memCache;
|
private readonly ICacheService _memCache;
|
||||||
private readonly IPlexContentSync _plexContentSync;
|
private readonly IPlexContentSync _plexContentSync;
|
||||||
private readonly IEmbyContentSync _embyContentSync;
|
private readonly IEmbyContentSync _embyContentSync;
|
||||||
|
private readonly INewsletterJob _newsletterJob;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs the update job
|
/// Runs the update job
|
||||||
|
@ -129,5 +131,16 @@ namespace Ombi.Controllers
|
||||||
BackgroundJob.Enqueue(() => _embyContentSync.Start());
|
BackgroundJob.Enqueue(() => _embyContentSync.Start());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Runs the newsletter
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("newsletter")]
|
||||||
|
public bool StartNewsletter()
|
||||||
|
{
|
||||||
|
BackgroundJob.Enqueue(() => _newsletterJob.Start());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue