Add transactional emails: welcome, professional submission, status changes
- mail/mail.service.ts: MailService with HTML templates (welcome, submitted, approved, rejected, pending, deactivated). Silent if SMTP not configured. - mail/mail.module.ts: global module so all services can inject MailService - auth.service.ts: send welcome email on register() - professionals.service.ts: notify admin on new submission; notify professional on approve/deny/deactivate/setPending Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
0a67f5d80a
commit
27f4a2d7ec
@@ -3,6 +3,7 @@ import { JwtService } from '@nestjs/jwt';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { SmsService } from '../sms/sms.service';
|
||||
import { MailService } from '../mail/mail.service';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService {
|
||||
@@ -10,6 +11,7 @@ export class AuthService {
|
||||
private prisma: PrismaService,
|
||||
private jwt: JwtService,
|
||||
private sms: SmsService,
|
||||
private mail: MailService,
|
||||
) {}
|
||||
|
||||
async register(email: string, password: string, name: string) {
|
||||
@@ -21,6 +23,7 @@ export class AuthService {
|
||||
data: { email, password_hash, name },
|
||||
});
|
||||
|
||||
this.mail.sendWelcome(name, email).catch(() => {});
|
||||
return this.generateToken(user);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user