-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Custom Email Provider (#1064)
* Added support for custom email provider * bump * bump * Dummy
- Loading branch information
1 parent
4a0e957
commit c9e8550
Showing
9 changed files
with
594 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,3 +95,4 @@ This project is licensed under the MPL-2.0 license. See the [LICENSE](LICENSE) f | |
report. | ||
|
||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ resource "auth0_email_provider" "sendgrid_email_provider" { | |
# This is an example on how to set up the email provider with Azure CS. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
resource "auth0_email_provider" "azure_cs_email_provider" { | ||
name = "azure_cs" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
@@ -63,7 +63,7 @@ resource "auth0_email_provider" "smtp_email_provider" { | |
# This is an example on how to set up the email provider with MS365. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
resource "auth0_email_provider" "ms365_email_provider" { | ||
name = "ms365" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
@@ -74,6 +74,15 @@ resource "auth0_email_provider" "smtp_email_provider" { | |
ms365_client_secret = "ms365_client_secret" | ||
} | ||
} | ||
# This is an example on how to set up the email provider with a custom action. | ||
# Make sure a corresponding action exists with custom-email-provider as supported triggers | ||
resource "auth0_email_provider" "custom_email_provider" { | ||
name = "custom" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials {} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
@@ -83,7 +92,7 @@ resource "auth0_email_provider" "smtp_email_provider" { | |
|
||
- `credentials` (Block List, Min: 1, Max: 1) Configuration settings for the credentials for the email provider. (see [below for nested schema](#nestedblock--credentials)) | ||
- `default_from_address` (String) Email address to use as the sender when no other "from" address is specified. | ||
- `name` (String) Name of the email provider. Options include `azure_cs`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. | ||
- `name` (String) Name of the email provider. Options include `azure_cs`, `custom`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. | ||
|
||
### Optional | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ resource "auth0_email_provider" "sendgrid_email_provider" { | |
|
||
|
||
# This is an example on how to set up the email provider with Azure CS. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
resource "auth0_email_provider" "azure_cs_email_provider" { | ||
name = "azure_cs" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
@@ -50,7 +50,7 @@ resource "auth0_email_provider" "smtp_email_provider" { | |
|
||
|
||
# This is an example on how to set up the email provider with MS365. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
resource "auth0_email_provider" "ms365_email_provider" { | ||
name = "ms365" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
@@ -61,3 +61,12 @@ resource "auth0_email_provider" "smtp_email_provider" { | |
ms365_client_secret = "ms365_client_secret" | ||
} | ||
} | ||
|
||
# This is an example on how to set up the email provider with a custom action. | ||
# Make sure a corresponding action exists with custom-email-provider as supported triggers | ||
resource "auth0_email_provider" "custom_email_provider" { | ||
name = "custom" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,24 @@ resource "auth0_email_provider" "my_email_provider" { | |
} | ||
` | ||
|
||
const testAccCreateCustomEmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "custom" | ||
enabled = true | ||
credentials {} | ||
default_from_address = "[email protected]" | ||
} | ||
` | ||
|
||
const testAccUpdateCustomEmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "custom" | ||
enabled = false | ||
default_from_address = "[email protected]" | ||
credentials {} | ||
} | ||
` | ||
|
||
const testAccAlreadyConfiguredEmailProviderWillNotConflict = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "mailgun" | ||
|
@@ -343,6 +361,22 @@ func TestAccEmail(t *testing.T) { | |
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_client_secret", "ms365_updated_client_secret"), | ||
), | ||
}, | ||
{ | ||
Config: testAccCreateCustomEmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "custom"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "true"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", "[email protected]"), | ||
), | ||
}, | ||
{ | ||
Config: testAccUpdateCustomEmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "custom"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "false"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", "[email protected]"), | ||
), | ||
}, | ||
{ | ||
Config: testAccAlreadyConfiguredEmailProviderWillNotConflict, | ||
Check: resource.ComposeTestCheckFunc( | ||
|
Oops, something went wrong.