Added feedback when we send a welcome email #1578

pull/1614/head
Jamie.Rees 7 years ago
parent 989be6df6c
commit 3c1078a332

@ -44,7 +44,7 @@ export class IdentityService extends ServiceAuthHelpers {
} }
public deleteUser(user: IUser): Observable<IIdentityResult> { public deleteUser(user: IUser): Observable<IIdentityResult> {
return this.http.delete(`${this.url}/${user.id}`, { headers: this.headers }).map(this.extractData); return this.http.delete(`${this.url}${user.id}`, { headers: this.headers }).map(this.extractData);
} }
public submitResetPassword(email: string): Observable<IIdentityResult> { public submitResetPassword(email: string): Observable<IIdentityResult> {

@ -28,11 +28,16 @@ export class UserManagementComponent implements OnInit {
} }
public welcomeEmail(user: IUser) { public welcomeEmail(user: IUser) {
if(!user.emailAddress) {
this.notificationService.error("Email", "The user needs an email address.");
return;
}
if (!this.emailSettings.enabled) { if (!this.emailSettings.enabled) {
this.notificationService.error("Email", "Email Notifications are not setup, cannot send welcome email"); this.notificationService.error("Email", "Email Notifications are not setup, cannot send welcome email");
return; return;
} }
this.identityService.sendWelcomeEmail(user).subscribe(); this.identityService.sendWelcomeEmail(user).subscribe();
this.notificationService.success("Email", `Sent a welcome email to ${user.emailAddress}`);
} }
public checkAllBoxes() { public checkAllBoxes() {

Loading…
Cancel
Save