@@ -30,7 +30,7 @@ import { UpdatePersonDto } from '../person/dto/update-person.dto'
30
30
import { ForgottenPasswordEmailDto } from './dto/forgot-password.dto'
31
31
import { JwtService } from '@nestjs/jwt'
32
32
import { EmailService } from '../email/email.service'
33
- import { ForgottenPasswordMailDto } from '../email/template.interface'
33
+ import { ForgottenPasswordMailDto , CorporateActivationEmailDto } from '../email/template.interface'
34
34
import { NewPasswordDto } from './dto/recovery-password.dto'
35
35
import { MarketingNotificationsService } from '../notifications/notifications.service'
36
36
import { PersonService } from '../person/person.service'
@@ -230,6 +230,21 @@ export class AuthService {
230
230
company = await this . createCompany ( registerDto )
231
231
}
232
232
person = await this . createPerson ( registerDto , user . id , company ?. id )
233
+
234
+ if ( isCorporateReg ) {
235
+ const mail = new CorporateActivationEmailDto ( {
236
+ corporateActivationTitle : 'Нова корпоративна регистрация' ,
237
+ companyName : registerDto . companyName || '' ,
238
+ representitiveName : `${ registerDto . firstName } ${ registerDto . lastName } ` ,
239
+ representitiveEmail : registerDto . email ,
240
+ activationLink : `${ this . config . get ( 'APP_URL' ) } /admin/users?search=${ registerDto . email } ` ,
241
+ } )
242
+ await this . sendEmail . sendFromTemplate (
243
+ mail ,
244
+ { to : [ this . config . get ( 'CORPORATE_DONORS_EMAIL' , '' ) ] } ,
245
+ { bypassUnsubscribeManagement : { enable : true } }
246
+ )
247
+ }
233
248
} catch ( error ) {
234
249
const response = {
235
250
error : error . message ,
0 commit comments