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

Improve Template Previews #197

Open
oudeismetis opened this issue Jun 22, 2023 · 3 comments
Open

Improve Template Previews #197

oudeismetis opened this issue Jun 22, 2023 · 3 comments
Labels
Feature good first issue Good for newcomers

Comments

@oudeismetis
Copy link
Member

#193 Introduced template previews.
Now you can navigate to a URL like https://tn-spa-bootstrapper-staging.herokuapp.com/api/template_preview/?template=registration/password_reset.html and see a preview of what that email would look like without having to trigger and receive an email.
This is great, but there could be some improvements:

  • If you don't pass it a template name, it should return a list of URLs with all templates it was able to self discover
  • The logic for this should probably be in common or utils instead of core
@WajahatKanju
Copy link

Could you please offer further elaboration? I'm seeking a more in-depth explanation.

@oudeismetis
Copy link
Member Author

For example, one of the arguments passed to most email templates is support_email, which displays at the bottom of the email. But because of how the template preview feature was built, there was no example support_email to pass. So nothing is displayed in the preview. Thus, the template preview isn't a complete preview of what that email would actually look like.

Example of a template preview in staging here: https://tn-spa-bootstrapper-staging.herokuapp.com/api/template_preview/?template=registration/password_reset.html

This is generated using this template: https://github.com/thinknimble/tn-spa-bootstrapper/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/server/%7B%7Bcookiecutter.project_slug%7D%7D/core/templates/registration/password_reset.html

Which extends this template where the support_email html code is rendered: https://github.com/thinknimble/tn-spa-bootstrapper/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/server/%7B%7Bcookiecutter.project_slug%7D%7D/core/templates/_action-email-base.html#L214

@whusterj
Copy link
Member

This is getting stale, but leaving it open as a good first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants