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

Cannot specify an empty string for from and subject in auth0_email_template resource #76

Closed
tennashi opened this issue Mar 3, 2022 · 1 comment
Labels
🪲 bug Something isn't working

Comments

@tennashi
Copy link

tennashi commented Mar 3, 2022

Describe the problem

PUT /api/v2/email-templates/{templateName} API requires from and subject field, but allows empty string.

But Bad Request error is returned if from or subject is an empty string in the resource definition.

What was the expected behavior?

The following resources can be applied.

resource "auth0_email_template" "verify_email" {
  template = "verify_email"
  enabled = false
  from = ""
  subject = ""
  syntax = "liquid"
  url_lifetime_in_seconds = 432000
  body = "some body"
}

Reproduction

  1. Write the following resource
resource "auth0_email_template" "verify_email" {
  template = "verify_email"
  enabled = false
  from = ""
  subject = ""
  syntax = "liquid"
  url_lifetime_in_seconds = 432000
  body = "some body"
}
  1. terraform apply
  2. The following error is output
Error: 400 Bad Request: Payload validation error: 'Missing required property: subject'. (also) Payload validation error: 'Missing required property: from'.

The following is the output with TF_LOG=DEBUG

2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1: 2022/03/03 11:24:10 [DEBUG] Template: {
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1:   "template": "verify_email",
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1:   "body": "some body",
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1:   "syntax": "liquid",
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1:   "urlLifetimeInSeconds": 432000,
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1:   "enabled": false
2022-03-03T11:24:10.023+0900 [DEBUG] provider.terraform-provider-auth0_v0.27.1: }

Environment

  • auth0/terraform-auth0-provider v0.27.1
@tennashi tennashi added the 🪲 bug Something isn't working label Mar 3, 2022
@sergiught
Copy link
Contributor

Hey @tennashi , thanks for opening this issue. This however is a duplicate of #14. We're aware of this but unfortunately the fix is not that straightforward to implement currently. We'll be looking more into this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants