diff --git a/api/src/services/email.service.ts b/api/src/services/email.service.ts index 46e85ff113..e852a0d643 100644 --- a/api/src/services/email.service.ts +++ b/api/src/services/email.service.ts @@ -237,29 +237,6 @@ export class EmailService { ); } - /* send account update email */ - async portalAccountUpdate( - jurisdictionIds: IdDTO[], - user: User, - appUrl: string, - ) { - const jurisdiction = await this.getJurisdiction(jurisdictionIds); - void (await this.loadTranslations(jurisdiction, user.language)); - const emailFromAddress = await this.getEmailToSendFrom( - jurisdictionIds, - jurisdiction, - ); - await this.send( - user.email, - emailFromAddress, - this.polyglot.t('invite.portalAccountUpdate'), - this.template('portal-account-update')({ - user, - appUrl, - }), - ); - } - /* send change of email email */ public async changeEmail( jurisdictionName: string, diff --git a/api/src/services/user.service.ts b/api/src/services/user.service.ts index c737c06faf..db6835a66f 100644 --- a/api/src/services/user.service.ts +++ b/api/src/services/user.service.ts @@ -717,25 +717,6 @@ export class UserService { confirmationUrl, ); } - - // Partner user that is given access to an additional jurisdiction - } else if ( - forPartners && - existingUser && - 'userRoles' in dto && - existingUser?.userRoles?.isPartner && - dto?.userRoles?.isPartner && - this.jurisdictionMismatch(dto.jurisdictions, existingUser.jurisdictions) - ) { - const newJurisdictions = this.getMismatchedJurisdictions( - dto.jurisdictions, - existingUser.jurisdictions, - ); - this.emailService.portalAccountUpdate( - newJurisdictions, - mapTo(User, newUser), - dto.appUrl, - ); } else if (forPartners) { const confirmationUrl = this.getPartnersConfirmationUrl( this.configService.get('PARTNERS_PORTAL_URL'), @@ -896,29 +877,19 @@ export class UserService { existingJurisdictions: IdDTO[], ): boolean { return ( - this.getMismatchedJurisdictions( - incomingJurisdictions, - existingJurisdictions, - ).length > 0 + incomingJurisdictions.reduce((misMatched, jurisdiction) => { + if ( + !existingJurisdictions?.some( + (existingJuris) => existingJuris.id === jurisdiction.id, + ) + ) { + misMatched.push(jurisdiction.id); + } + return misMatched; + }, []).length > 0 ); } - getMismatchedJurisdictions( - incomingJurisdictions: IdDTO[], - existingJurisdictions: IdDTO[], - ) { - return incomingJurisdictions.reduce((misMatched, jurisdiction) => { - if ( - !existingJurisdictions?.some( - (existingJuris) => existingJuris.id === jurisdiction.id, - ) - ) { - misMatched.push(jurisdiction.id); - } - return misMatched; - }, []); - } - containsInvalidCharacters(value: string): boolean { return value.includes('.') || value.includes('http'); } diff --git a/api/src/views/portal-account-update.hbs b/api/src/views/portal-account-update.hbs deleted file mode 100644 index a046a1c28e..0000000000 --- a/api/src/views/portal-account-update.hbs +++ /dev/null @@ -1,11 +0,0 @@ -

- - {{t "invite.userUpdate"}} {{> user-name }} - -

-

- {{t "invite.userUpdateNewListings"}} -

-{{appUrl}} -
-{{> simple-footer }}