Skip to content

Commit e9f7144

Browse files
committed
fix(auth): send email with template ID
- Added sender email to email sending - Used environment config for template ID - Improved email sending robustness
1 parent f1d8c05 commit e9f7144

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/src/services/auth_service.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22

3+
import 'package:ht_api/src/config/environment_config.dart';
34
import 'package:ht_api/src/rbac/permission_service.dart';
45
import 'package:ht_api/src/rbac/permissions.dart';
56
import 'package:ht_api/src/services/auth_token_service.dart';
@@ -102,7 +103,12 @@ class AuthService {
102103
.generateAndStoreSignInCode(email);
103104

104105
// Send the code via email
105-
await _emailRepository.sendOtpEmail(recipientEmail: email, otpCode: code);
106+
await _emailRepository.sendOtpEmail(
107+
senderEmail: EnvironmentConfig.defaultSenderEmail,
108+
recipientEmail: email,
109+
templateId: EnvironmentConfig.otpTemplateId,
110+
otpCode: code,
111+
);
106112
_log.info('Initiated email sign-in for $email, code sent.');
107113
} on HtHttpException {
108114
// Propagate known exceptions from dependencies or from this method's logic.

0 commit comments

Comments
 (0)