refactor: migrate services from app.config to unified config

- Update email verification template to use unifiedConfig
- Update ProductionDatabaseStrategy to use databaseConfig from unified config
- Update mailgun service to use unifiedConfig for baseUrl
- Provides consistent configuration access across all services
- Part of migration to single source of truth configuration system
This commit is contained in:
William Valentin
2025-09-08 20:39:03 -07:00
parent 6f1cf76a86
commit 811339cea2
3 changed files with 8 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
*/
import { getMailgunConfig, type MailgunConfig } from './mailgun.config';
import { appConfig } from '../config/app.config';
import { unifiedConfig } from '../config/unified.config';
interface EmailTemplate {
subject: string;
@@ -139,13 +139,13 @@ export class MailgunService {
}
async sendVerificationEmail(email: string, token: string): Promise<boolean> {
const verificationUrl = `${appConfig.baseUrl}/verify-email?token=${token}`;
const verificationUrl = `${unifiedConfig.app.baseUrl}/verify-email?token=${token}`;
const template = this.getVerificationEmailTemplate(verificationUrl);
return this.sendEmail(email, template);
}
async sendPasswordResetEmail(email: string, token: string): Promise<boolean> {
const resetUrl = `${appConfig.baseUrl}/reset-password?token=${token}`;
const resetUrl = `${unifiedConfig.app.baseUrl}/reset-password?token=${token}`;
const template = this.getPasswordResetEmailTemplate(resetUrl);
return this.sendEmail(email, template);
}