Skip to content

Commit

Permalink
Email preview with default body when not customized
Browse files Browse the repository at this point in the history
  • Loading branch information
raygig committed Aug 25, 2023
1 parent 0325f8e commit b846970
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@firestitch/app-message",
"title": "Admin",
"description": "@firestitch/admin",
"version": "12.7.4",
"version": "12.7.5",
"repository": {
"type": "git",
"url": "https://github.com/Firestitch/ngx-admin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
<div fxLayout="row" fxLayoutGap="10px">
<mat-form-field>
<mat-select
required
placeholder="Customize Message"
[(ngModel)]="message.emailMessage.customize"
name="customizeEmail">
<mat-option [value]="true">Yes</mat-option>
<mat-option [value]="false">No</mat-option>
</mat-select>
required
placeholder="Customize Message"
[(ngModel)]="message.emailMessage.customize"
name="customizeEmail">
<mat-option [value]="true">Yes</mat-option>
<mat-option [value]="false">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ export class MessageComponent implements OnInit {
}

public openPreview(): void {
let html = this.message.emailMessage.body;
let styles = this.message.emailMessage.styles;
const emailMessage = this.message.emailMessage;
let html = emailMessage.customize ? emailMessage.body : this.message.defaultEmailBody;
let styles = emailMessage.styles;

if (this.message.emailMessage.messageTemplateId) {
if (emailMessage.messageTemplateId) {
const messageTemplate = this.messageTemplates
.find((item) => {
return this.message.emailMessage.messageTemplateId === item.id;
return emailMessage.messageTemplateId === item.id;
});

if (messageTemplate) {
Expand Down

0 comments on commit b846970

Please sign in to comment.