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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user