Skip to content
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

feat: add MailType as email template parameter #1451

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ryanhalliday
Copy link

@ryanhalliday ryanhalliday commented Feb 23, 2024

What kind of change does this PR introduce?

Tiny feature, include the MailType in mail template data so that you can build URLs more dynamically. Rely less on strings.

What is the current behavior?

Users have to type out magic strings and have to know type manually for each mail type

What is the new behavior?

{{ .MailType }} can be used in email templates

Additional context

Introduces const in template.go - I know these strings are used elsewhere (verify.go) but they couldn't be cleanly imported and deal with different concerns. Maybe unifying them is an idea one day.

I had to write a different docs PR here so this sort of fixes that: supabase/supabase#21466

TODO?

Likely needs docs update for this section of the Supabase dashboard:
image

Let me know if you want that PR too, should be easy.

@ryanhalliday ryanhalliday requested a review from a team as a code owner February 23, 2024 22:44
@ryanhalliday
Copy link
Author

ryanhalliday commented Feb 23, 2024

lmk if I need to fix the conventional commit thing or if that is fine to do at merge.

@hf hf changed the title MailType as email template parameter feat: add MailType as email template parameter Mar 5, 2024
Copy link
Contributor

@hf hf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good!

internal/mailer/template.go Outdated Show resolved Hide resolved
@hf
Copy link
Contributor

hf commented Mar 5, 2024

Can you add some examples to the docs? Or at least here in comments / PR description, so that we can add it in official Supabase docs?

@ryanhalliday
Copy link
Author

Docs PR added, let me know if any of it needs tweaks!

@ryanhalliday
Copy link
Author

@hf resolved merge conflicts in this and docs PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants