42 lines
1.7 KiB
HTML
42 lines
1.7 KiB
HTML
<form [formGroup]="emailForm" (ngSubmit)="onSubmit()">
|
|
|
|
<h1 mat-dialog-title *ngIf="emailForm.get('id')?.value">Edit Email Template</h1>
|
|
<h1 mat-dialog-title *ngIf="!emailForm.get('id')?.value">New Email Template</h1>
|
|
|
|
<div mat-dialog-content>
|
|
|
|
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;" *ngIf="emailForm.get('id')?.value">
|
|
<mat-label>ID</mat-label>
|
|
<input matInput formControlName="id" readonly="readonly" />
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;">
|
|
<mat-label>Description</mat-label>
|
|
<input matInput formControlName="description" />
|
|
<mat-error *ngIf="emailForm.get('description')?.invalid">This field is <strong>required</strong></mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;">
|
|
<mat-label>Email: subject</mat-label>
|
|
<input matInput formControlName="subject" />
|
|
<mat-error *ngIf="emailForm.get('subject')?.invalid">This field is <strong>required</strong></mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;">
|
|
<mat-label>Email: message</mat-label>
|
|
<textarea matInput formControlName="message" required rows="16" style="font-size: 0.8em;"></textarea>
|
|
<mat-error *ngIf="emailForm.get('message')?.invalid">This field is <strong>required</strong></mat-error>
|
|
</mat-form-field>
|
|
|
|
</div>
|
|
|
|
<div mat-dialog-actions>
|
|
<button mat-stroked-button color="primary" type="submit" [disabled]="!emailForm.valid">Submit</button>
|
|
<button mat-stroked-button color="primary" mat-dialog-close>Close</button>
|
|
<mat-error *ngIf="emailForm.errors?.['serverError']">
|
|
{{ emailForm.errors?.['serverError'] }}
|
|
</mat-error>
|
|
</div>
|
|
|
|
</form>
|