-
Notifications
You must be signed in to change notification settings - Fork 253
fix: templates not being used for custom smtp #2865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: appwrite/console
Length of output: 3816
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 1872
🏁 Script executed:
Repository: appwrite/console
Length of output: 978
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 42
🏁 Script executed:
Repository: appwrite/console
Length of output: 614
🏁 Script executed:
Repository: appwrite/console
Length of output: 6429
🏁 Script executed:
Repository: appwrite/console
Length of output: 44
🏁 Script executed:
Repository: appwrite/console
Length of output: 639
🏁 Script executed:
Repository: appwrite/console
Length of output: 44
🏁 Script executed:
rg "enum EmailTemplateType|EmailTemplateType\s*=" --type ts --type tsx -B 2 -A 15Repository: appwrite/console
Length of output: 87
🏁 Script executed:
Repository: appwrite/console
Length of output: 69
🏁 Script executed:
Repository: appwrite/console
Length of output: 115
🏁 Script executed:
Repository: appwrite/console
Length of output: 3475
🏁 Script executed:
Repository: appwrite/console
Length of output: 782
🌐 Web query:
@appwrite.io/console EmailTemplateType enum members💡 Result:
In Appwrite, the email template types (exposed as
EmailTemplateTypein the Console SDK@appwrite.io/console) correspond to these built-in template categories:Citations:
🌐 Web query:
appwrite console SDK EmailTemplateType magicSession otpSession💡 Result:
In the Appwrite Console SDK (
@appwrite.io/console), theEmailTemplateTypeenum usesMagicsessionandOtpsession(notmagicSession/otpSession) and they map to these string values:"magicsession"and"otpsession". [1]These correspond to the email templates used for Magic URL login and Email OTP login flows in Appwrite. [2][3]
Sources
[1] Appwrite Console SDK types:
email-template-type.d.ts(jsDelivr)[2] Appwrite Docs: Email OTP
[3] Appwrite Docs: Message templates / email templates
Add TODO comments documenting the enum value mismatch workaround.
The four changed keys use
'...' as EmailTemplateTypetype assertions because the@appwrite.io/consoleSDK's enum members (Magicsession,Otpsession,Mfachallenge,Sessionalert) hold all-lowercase string values ("magicsession","otpsession", etc.), which don't match the camelCase strings the API expects ("magicSession","otpSession", etc.). Usingas EmailTemplateTypebypasses type safety—if the SDK is ever updated with correct enum members, this code won't be caught by the type system.Add
// TODOcomments to each of the four lines (54, 60, 78, 84) explaining the workaround, following the guideline to comment complex logic. Example:The inconsistency of mixing three direct enum references (
Verification,Recovery,Invitation) with four string literal assertions should be resolved once the SDK is fixed.Also applies to: 60-60, 78-78, 84-84
🤖 Prompt for AI Agents