#865 #1459 Added the Sender From field for email notifcations. We can now have "Friendly Names" for email notifications.

Also fixed the copy and paste error with the Settings dropdowns. Slack menu item is now labelled Slack instead of Discord
pull/1488/head
Jamie.Rees 7 years ago
parent d5477adc6b
commit 03add0ffc8

@ -29,7 +29,7 @@ namespace Ombi.Notifications
Body = body.ToMessageBody(),
Subject = model.Subject
};
message.From.Add(new MailboxAddress(settings.Sender, settings.Sender));
message.From.Add(new MailboxAddress(settings.SenderAddress, settings.SenderAddress));
message.To.Add(new MailboxAddress(model.To, model.To));
using (var client = new SmtpClient())
@ -71,7 +71,8 @@ namespace Ombi.Notifications
Body = body.ToMessageBody(),
Subject = model.Subject
};
message.From.Add(new MailboxAddress(settings.Sender, settings.Sender));
message.From.Add(new MailboxAddress(string.IsNullOrEmpty(settings.SenderName) ? settings.SenderAddress : settings.SenderName, settings.SenderAddress));
message.To.Add(new MailboxAddress(model.To, model.To));
using (var client = new SmtpClient())

@ -6,7 +6,8 @@
public string Host { get; set; }
public string Password { get; set; }
public int Port { get; set; }
public string Sender { get; set; }
public string SenderName { get; set; }
public string SenderAddress { get; set; }
public string Username { get; set; }
public bool Authentication { get; set; }
public string AdminEmail { get; set; }

@ -10,7 +10,8 @@ export interface IEmailNotificationSettings extends INotificationSettings {
host: string,
password: string,
port: number,
sender: string,
senderAddress: string,
senderName:string,
username: string,
authentication: boolean,
adminEmail: string,

@ -21,8 +21,8 @@
<div *ngIf="emailForm.invalid && emailForm.dirty" class="alert alert-danger">
<div *ngIf="emailForm.get('host').hasError('required')">Host is required</div>
<div *ngIf="emailForm.get('port').hasError('required')">The Port is required</div>
<div *ngIf="emailForm.get('sender').hasError('required')">The Email Sender is required</div>
<div *ngIf="emailForm.get('sender').hasError('incorrectMailFormat')">The Email Sender needs to be a valid email address</div>
<div *ngIf="emailForm.get('senderAddress').hasError('required')">The Email Sender Address is required</div>
<div *ngIf="emailForm.get('senderAddress').hasError('incorrectMailFormat')">The Email Sender Address needs to be a valid email address</div>
<div *ngIf="emailForm.get('adminEmail').hasError('required')">The Email Sender is required</div>
<div *ngIf="emailForm.get('adminEmail').hasError('email')">The Admin Email needs to be a valid email address</div>
<div *ngIf="emailForm.get('username').hasError('required')">The Username is required</div>
@ -44,10 +44,16 @@
</div>
<div class="form-group">
<label for="sender" class="control-label">Email Sender</label>
<div>
<input type="text" class="form-control form-control-custom " id="sender" name="sender" formControlName="sender" tooltipPosition="top" pTooltip="The email address that the emails will be sent from">
<label style="padding-left: 0" for="senderAddress" class="control-label col-md-12">Email Sender</label>
<div style="padding-left: 0" class="col-md-6">
<input type="text" class="form-control form-control-custom " id="senderAddress" name="senderAddress" formControlName="senderAddress" tooltipPosition="top" placeholder="Sender Address" pTooltip="The email address that the emails will be sent from">
</div>
<div style="padding-left: 0" class="col-md-6">
<input type="text" class="form-control form-control-custom " id="senderName" name="senderName" formControlName="senderName" tooltipPosition="top" placeholder="Sender Name" pTooltip="The 'Friendly' name that will appear in the 'FROM:' part of the email">
</div>
<br/>
<br/>
<br/>
</div>
<div class="form-group">

@ -32,7 +32,8 @@ export class EmailNotificationComponent implements OnInit {
host: [x.host, [Validators.required]],
password: [x.password],
port: [x.port, [Validators.required]],
sender: [x.sender, [Validators.required, Validators.email]],
senderAddress: [x.senderAddress, [Validators.required, Validators.email]],
senderName: [x.senderName],
username: [x.username],
adminEmail: [x.adminEmail, [Validators.required, Validators.email]],
});

@ -1,4 +1,4 @@
<i class="fa fa-info-circle" tooltipPosition="top" [escape]="false" pTooltip="{{helpText}}"></i>
<i class="fa fa-info-circle" tooltipPosition="left" [escape]="false" pTooltip="{{helpText}}"></i>
<ngb-accordion [closeOthers]="true" activeIds="0-header">

@ -45,7 +45,7 @@
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Email']">Email</a></li>
<!--<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Newsletter']">Newsletter</a></li>-->
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Discord']">Discord</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Slack']">Discord</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Slack']">Slack</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushbullet']">Pushbullet</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Pushover']">Pushover</a></li>
</ul>

Loading…
Cancel
Save