auth0 / auth0-cli

Build, manage and test your Auth0 integrations from the command line
https://auth0.github.io/auth0-cli/
MIT License
238 stars 51 forks source link

Add support for importing email templates #988

Closed weirdian2k3 closed 3 weeks ago

weirdian2k3 commented 4 months ago

πŸ”§ Changes

This adds support for importing email templates into terraform from an existing auth0 install. This is helpful because if you are onboarding your terraform, you don't have to manually create the resources for the email templates.

πŸ”¬ Testing

Go into your auth0 install and set a custom template for one of the templates (for this example, I'm doing reset email)

Run the auth0 cli terraform import to create the auth0_generated.tf file

Note that in the auth0_generated.tf, you have the following block with the pasrameters you set in the auth0 portal populates correctly

resource "auth0_email_template" "reset_email" {
  body                      = "the contents of the email you set up"
  enabled                   = true
  from                      = "Foo <no-reply@example.org>"
  include_email_in_redirect = false
  result_url                = null
  subject                   = ""
  syntax                    = "liquid"
  template                  = "reset_email"
  url_lifetime_in_seconds   = 432000
}

πŸ“ Checklist

developerkunal commented 1 month ago

Hi @weirdian2k3,

I hope you're having a nice day! I'm looking through your PR, but it requires test cases. If you can add test cases or need help with that, please let me know.

Thank you for the contribution!

developerkunal commented 3 weeks ago

Hi @weirdian2k3,

I hope you are having a great day.

I have added the necessary documentation and test cases. Could you please merge this branch with yours or open a new PR with these changes?

Here's the link to the branch: GitHub Branch

Thank you!