diff --git a/src/app/account-app/account-app.component.html b/src/app/account-app/account-app.component.html
index 2580c238f..8aec1ed97 100644
--- a/src/app/account-app/account-app.component.html
+++ b/src/app/account-app/account-app.component.html
@@ -90,7 +90,7 @@
- Personal Details
+ Personal Details
diff --git a/src/app/account-details/personal-details.component.html b/src/app/account-details/personal-details.component.html
index 68608bb2d..16bdc497c 100644
--- a/src/app/account-details/personal-details.component.html
+++ b/src/app/account-details/personal-details.component.html
@@ -75,6 +75,7 @@ Address details
+
diff --git a/src/app/account-details/personal-details.component.ts b/src/app/account-details/personal-details.component.ts
index 4b18882ae..a68516dfa 100644
--- a/src/app/account-details/personal-details.component.ts
+++ b/src/app/account-details/personal-details.component.ts
@@ -48,6 +48,7 @@ export class PersonalDetailsComponent {
modal_password_ref;
details: Subject = new Subject();
+ is_alternative_email_validated = true;
selectedCountry: any;
selectedTimezone: any;
@@ -60,6 +61,7 @@ export class PersonalDetailsComponent {
) {
this.details.subscribe((details: AccountDetailsInterface) => {
this.detailsForm.patchValue(details);
+ this.is_alternative_email_validated = details.email_alternative_status == 0;
});
this.loadDetails();
@@ -158,10 +160,20 @@ export class PersonalDetailsComponent {
.post('/rest/v1/account/details', updates)
.pipe(map((res: HttpResponse) => res['result']))
.subscribe((details) => {
- this.details.next(details);
+ if(details && details.email_alternative) {
+ this.details.next(details);
+ this.rmm.show_error('Account details updated', 'Dismiss');
+ } else {
+ this.rmm.show_error('Failed to update details', 'Dismiss');
+ }
});
+ }
- this.rmm.show_error('Account details updated', 'Dismiss');
+ public validate_alt_email() {
+ this.http.post('/rest/v1/account/alt_email_validation', {})
+ .subscribe((res) => {
+ this.rmm.show_error('Validation email resent', 'Dismiss');
+ });;
}
show_modal_password() {
diff --git a/src/app/rmm/account-details.ts b/src/app/rmm/account-details.ts
index 60a661759..09cbaf60b 100644
--- a/src/app/rmm/account-details.ts
+++ b/src/app/rmm/account-details.ts
@@ -24,6 +24,7 @@ export interface AccountDetailsInterface {
first_name: string;
last_name: string;
email_alternative: string;
+ email_alternative_status: number;
phone_number: number;
company: string;
org_number: number;
diff --git a/src/app/welcome/welcomedesk.component.html b/src/app/welcome/welcomedesk.component.html
index c3403d08c..6ceeb8e8a 100644
--- a/src/app/welcome/welcomedesk.component.html
+++ b/src/app/welcome/welcomedesk.component.html
@@ -3,6 +3,7 @@
Congratulations -- your new Runbox account is ready!
Take advantage of our current 20% discount by proceeding to Plans & Upgrades below.
+
diff --git a/src/app/welcome/welcomedesk.component.spec.ts b/src/app/welcome/welcomedesk.component.spec.ts
index 994712e33..c99110caa 100644
--- a/src/app/welcome/welcomedesk.component.spec.ts
+++ b/src/app/welcome/welcomedesk.component.spec.ts
@@ -18,6 +18,7 @@
// ---------- END RUNBOX LICENSE ----------
import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { RunboxWebmailAPI } from '../rmmapi/rbwebmail';
import { WelcomeDeskComponent } from './welcomedesk.component';
import { ActivatedRoute, Router, convertToParamMap } from '@angular/router';
import { of } from 'rxjs';
@@ -37,8 +38,11 @@ describe('WelcomeDeskComponent', () => {
provide: ActivatedRoute,
useValue: {
queryParams: of(convertToParamMap({offer: 'y'}))
- }
+ },
},
+ { provide: RunboxWebmailAPI, useValue: {
+ me: of({first_name: 'Test', last_name: 'User'}),
+ }, }
]
})
.compileComponents();
diff --git a/src/app/welcome/welcomedesk.component.ts b/src/app/welcome/welcomedesk.component.ts
index 53fc183b7..0a1ab40a4 100644
--- a/src/app/welcome/welcomedesk.component.ts
+++ b/src/app/welcome/welcomedesk.component.ts
@@ -19,6 +19,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
+import { RunboxMe, RunboxWebmailAPI } from '../rmmapi/rbwebmail';
@Component({
selector: 'app-welcome',
@@ -27,10 +28,14 @@ import { ActivatedRoute } from '@angular/router';
})
export class WelcomeDeskComponent implements OnInit {
+ public me: RunboxMe;
constructor(
private activatedRoute: ActivatedRoute,
- ) { }
+ public rmmapi: RunboxWebmailAPI
+ ) {
+ this.rmmapi.me.subscribe(me => this.me = me);
+ }
public postSignup = ''