Update email provider settings in TF to use Mailgun (#2978)

New TF variables have been added to both Staging and Production
workspaces under the key `mailgun_server_api_token`
This commit is contained in:
Brian Manifold
2023-12-26 09:29:06 -05:00
committed by GitHub
parent 1c41f71e36
commit 86684b464a
5 changed files with 20 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ alias Domain.{Repo, Accounts, Auth, Actors, Relays, Gateways, Resources, Policie
# Seeds can be run both with MIX_ENV=prod and MIX_ENV=test, for test env we don't have
# an adapter configured and creation of email provider will fail, so we will override it here.
System.put_env("OUTBOUND_EMAIL_ADAPTER", "Elixir.Swoosh.Adapters.Postmark")
System.put_env("OUTBOUND_EMAIL_ADAPTER", "Elixir.Swoosh.Adapters.Mailgun")
# This function is used to update fields if STATIC_SEEDS is set,
# which helps with static docker-compose environment for local development.

View File

@@ -510,15 +510,18 @@ locals {
# Emails
{
name = "OUTBOUND_EMAIL_ADAPTER"
value = "Elixir.Swoosh.Adapters.Postmark"
value = "Elixir.Swoosh.Adapters.Mailgun"
},
{
name = "OUTBOUND_EMAIL_FROM"
value = "support@firezone.dev"
value = "notifications@firezone.dev"
},
{
name = "OUTBOUND_EMAIL_ADAPTER_OPTS"
value = "{\"api_key\":\"${var.postmark_server_api_token}\"}"
name = "OUTBOUND_EMAIL_ADAPTER_OPTS"
value = jsonencode({
api_key = var.mailgun_server_api_token,
domain = local.tld
})
},
# Feature Flags
{

View File

@@ -33,6 +33,10 @@ variable "postmark_server_api_token" {
type = string
}
variable "mailgun_server_api_token" {
type = string
}
variable "pagerduty_auth_token" {
type = string
}

View File

@@ -463,16 +463,17 @@ locals {
# Emails
{
name = "OUTBOUND_EMAIL_ADAPTER"
value = "Elixir.Swoosh.Adapters.Postmark"
value = "Elixir.Swoosh.Adapters.Mailgun"
},
{
name = "OUTBOUND_EMAIL_FROM"
value = "support@firez.one"
value = "notifications@firez.one"
},
{
name = "OUTBOUND_EMAIL_ADAPTER_OPTS"
value = jsonencode({
api_key = var.postmark_server_api_token
api_key = var.mailgun_server_api_token,
domain = local.tld
})
},
# Feature Flags

View File

@@ -27,3 +27,7 @@ variable "slack_alerts_auth_token" {
variable "postmark_server_api_token" {
type = string
}
variable "mailgun_server_api_token" {
type = string
}