Add MailerSend and template-based email verification
Introduced support for MailerSend as an email provider alongside SMTP, with configuration options in settings. Added Jinja2-based multi-language email templates for verification emails, and refactored the email sending logic to use these templates and support language selection based on user country code. Updated related services and API endpoints to pass country code and handle new response formats. Added dependencies for Jinja2 and MailerSend.
This commit is contained in:
@@ -96,7 +96,14 @@ class SessionState:
|
||||
|
||||
# 这里可以触发邮件发送
|
||||
await EmailVerificationService.send_verification_email(
|
||||
self.db, self.redis, self.user.id, self.user.username, self.user.email, None, None
|
||||
self.db,
|
||||
self.redis,
|
||||
self.user.id,
|
||||
self.user.username,
|
||||
self.user.email,
|
||||
None,
|
||||
None,
|
||||
self.user.country_code,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error issuing mail: {e}")
|
||||
|
||||
Reference in New Issue
Block a user