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:
Lizandro Guarnizo
2026-06-29 11:01:45 -05:00
co-authored by Claude Sonnet 4.6
parent 0a67f5d80a
commit 27f4a2d7ec
5 changed files with 282 additions and 11 deletions
+3
View File
@@ -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);
}