Skip to content

Commit

Permalink
Rename SMTP_REPLY_TO to SMTP_ADMIN_INBOX
Browse files Browse the repository at this point in the history
Signed-off-by: Andrés Vidal <andres@wyeworks.com>
  • Loading branch information
andres-vidal committed Jun 6, 2024
1 parent ddd58c3 commit 6f87342
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Environment variables are configuration units relevant to the app's build or run
|`SMTP_FROM`|Default name to be used in behalf of the application||
|`SMTP_NAME`|Default name to be used in behalf of the application|`Richard & Isabel Burton`|
|`SMTP_TLS`|Wether TLS is used in the communication to the SMTP service. Can be `always`, `never` or `if_available`| `if_available`|
|`SMTP_REPLY_TO`| Reply inbox to be addressed when answering to emails from this app. Also used as administrative inbox, for example, to receive "Contact Form" messages.|
|`SMTP_ADMIN_INBOX`| Administrative inbox, for example, to receive "Contact Form" messages.|



Expand Down
2 changes: 1 addition & 1 deletion backend/lib/richard_burton/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule RichardBurton.Application do
"SMTP_FROM",
"SMTP_NAME",
"SMTP_TLS",
"SMTP_REPLY_TO"
"SMTP_ADMIN_INBOX"
]
|> Enum.map(&{&1, &1 |> String.downcase() |> String.to_atom()})
|> Enum.filter(fn {key, _} -> is_nil(System.get_env(key)) end)
Expand Down
5 changes: 2 additions & 3 deletions backend/lib/richard_burton/mailer_smtp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule RichardBurton.Mailer.SMTP do
defp get_swoosh_email(email = %{message: message, address: address, to: nil}) do
new(
from: get_from(),
to: System.get_env("SMTP_REPLY_TO"),
to: System.get_env("SMTP_ADMIN_INBOX"),
subject: get_subject(email),
text_body: message,
reply_to: address
Expand All @@ -52,8 +52,7 @@ defmodule RichardBurton.Mailer.SMTP do
from: get_from(),
to: to,
subject: subject,
text_body: message,
reply_to: System.get_env("SMTP_REPLY_TO")
text_body: message
)
end

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
SMTP_FROM: $SMTP_FROM
SMTP_NAME: $SMTP_NAME
SMTP_TLS: $SMTP_TLS
SMTP_REPLY_TO: $SMTP_REPLY_TO
SMTP_ADMIN_INBOX: $SMTP_ADMIN_INBOX

depends_on:
- db
Expand Down

0 comments on commit 6f87342

Please sign in to comment.