-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #686 from bpatrik/top-pick-sending
Improving e-mail sending #683
- Loading branch information
Showing
9 changed files
with
41 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,17 +44,11 @@ export class TopPickSendJob extends Job<{ | |
defaultValue: 5, | ||
}, { | ||
id: 'emailTo', | ||
type: 'email', | ||
type: 'string-array', | ||
name: backendTexts.emailTo.name, | ||
description: backendTexts.emailTo.description, | ||
defaultValue: '', | ||
}, { | ||
id: 'emailFrom', | ||
type: 'email', | ||
name: backendTexts.emailFrom.name, | ||
description: backendTexts.emailFrom.description, | ||
defaultValue: '[email protected]', | ||
}, { | ||
defaultValue: [], | ||
}, { | ||
id: 'emailSubject', | ||
type: 'string', | ||
name: backendTexts.emailSubject.name, | ||
|
@@ -105,7 +99,6 @@ export class TopPickSendJob extends Job<{ | |
this.Progress.log('Sending emails'); | ||
const messenger = new EmailMediaMessenger(); | ||
await messenger.sendMedia({ | ||
from: this.config.emailFrom, | ||
to: this.config.emailTo, | ||
subject: this.config.emailSubject, | ||
text: this.config.emailText | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ import {SubConfigClass} from '../../../../node_modules/typeconfig/src/decorators | |
import {ConfigPriority, TAGS} from '../public/ClientConfig'; | ||
import {ConfigProperty} from '../../../../node_modules/typeconfig/src/decorators/property/ConfigPropoerty'; | ||
import {ServerConfig} from './PrivateConfig'; | ||
|
||
declare let $localize: (s: TemplateStringsArray) => string; | ||
|
||
if (typeof $localize === 'undefined') { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
global.$localize = (s) => s; | ||
} | ||
|
||
export enum EmailMessagingType { | ||
sendmail = 1, | ||
SMTP = 2, | ||
|
@@ -91,6 +93,16 @@ export class EmailMessagingConfig { | |
}) | ||
type: EmailMessagingType = EmailMessagingType.sendmail; | ||
|
||
@ConfigProperty<EmailMessagingType, EmailMessagingConfig>({ | ||
tags: | ||
{ | ||
name: $localize`Sender email`, | ||
priority: ConfigPriority.advanced, | ||
} as TAGS, | ||
description: $localize`Some services do not allow sending from random e-mail addresses. Set this accordingly.` | ||
}) | ||
emailFrom: string = '[email protected]'; | ||
|
||
@ConfigProperty({ | ||
tags: | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,12 +176,12 @@ | |
[(ngModel)]="schedule.config[configEntry.id]" required> | ||
</ng-container> | ||
|
||
<ng-container *ngSwitchCase="'email'"> | ||
<input type="email" class="form-control" [name]="configEntry.id+'_'+i" | ||
<ng-container *ngSwitchCase="'string-array'"> | ||
<input type="text" class="form-control" | ||
[name]="configEntry.id+'_'+i" | ||
[id]="configEntry.id+'_'+i" | ||
placeholder="[email protected]" | ||
(ngModelChange)="onChange($event)" | ||
[(ngModel)]="schedule.config[configEntry.id]" required> | ||
(ngModelChange)="setEmailArray(schedule.config,configEntry.id,$event); onChange($event);" | ||
[ngModel]="getArray($any(schedule.config),configEntry.id)" required> | ||
</ng-container> | ||
|
||
<ng-container *ngSwitchCase="'number'"> | ||
|
@@ -196,7 +196,7 @@ | |
[name]="configEntry.id+'_'+i" | ||
[id]="configEntry.id+'_'+i" | ||
(ngModelChange)="setNumberArray(schedule.config,configEntry.id,$event); onChange($event);" | ||
[ngModel]="getNumberArray($any(schedule.config),configEntry.id)" required> | ||
[ngModel]="getArray($any(schedule.config),configEntry.id)" required> | ||
</ng-container> | ||
|
||
<app-gallery-search-field | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters