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

Disabled emailTemplates fail without a body. #632

Open
cv711 opened this issue Aug 18, 2022 · 1 comment
Open

Disabled emailTemplates fail without a body. #632

cv711 opened this issue Aug 18, 2022 · 1 comment

Comments

@cv711
Copy link

cv711 commented Aug 18, 2022

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description

The following configuration should be processed without any issues:

emailTemplates:
      - template: "verify_email"
        enabled: false

Probably because the parsing logic always tries to load a template from a .html file without checking if it's enabled or not.

Reproduction

Can easily be reproduced by adding the above code snippet in the tenant-config

Environment

Please provide the following:

  • Version of this library used: 7.14.2
@cv711 cv711 changed the title Disabled emailTemplates fail without a body. Disabled emailTemplates fail without a body. Aug 18, 2022
@willvedd
Copy link
Contributor

Appreciate the feedback! This type of request is quite common, see: #384, #293, #417. While I absolutely see your point of view here, it's a delicate balancing act of enabling developer flexibility and providing basic safeguard. At some point in time (before me), a decision was made to ensure the existence of a template files. I can understand why too, in general, it's better to prevent destructive changes from lack of HTML than it is to enable some developer convenience. Especially so when there is no consequence to passing an HTML value when disabling.

We're rethinking the way we import files, the hoping is that we'll enable both safety and DX. But that'll be down the line in the next major version. While this is excellent feedback, I'd rather dedicate work to a more holistic solution rather than temporarily sacrificing safety for a little convenience. I hope you can understand this pragmatic stance.

As a workaround, I'd advise to include a template, empty or otherwise.

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

No branches or pull requests

2 participants