-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We want to avoid calling Mail templates that don't exist in production. We also want to avoid calling mail templates with the wrong or missing data.
The first part is to create a registry of Mail templates. This way, we have an explicit list of the templates we expect to exist in production.
Possible ways to define the registry:
- In settings
MAIL_REGISTRY = {
'Forgot Password': {
'email': 'example@example.com',
'reset_url': 'example.com/forgot/1234/12'
},
'Confirm Email': {
'email': 'example@example.com',
'confirm_url': 'example.com/confirm/1234/12'
},
...
}
- With decorators
@mail('Forgot Password')
def forgot_password(email, reset_url):
...
Open to other ideas for managing the registry as well.
Beyond just having a registry, it would be ideal to automate syncing templates from local development to the staging and productions servers. Iterating on a solution that @adriaanwm has implemented before:
- We define the staging and production API URLs in settings.
- We implement an api endpoint to check/sync templates.
- On Mail model save, we check those endpoints to sync our template from local to production (if it meets data requirements etc.)
This is just one idea to automate syncing of templates from local development to the staging and production servers. Ideas are welcomed!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request