5
11
Fork
You've already forked tomato
1

Make email sender configurable #73

Manually merged
edwardloveall merged 2 commits from el-email-sender-config into main 2026年01月22日 15:08:57 +01:00

When an organization or a user got an invite or alert from Rootable, it was from
"software@foodrescuealliance.org." This has caused a lot of confusions when
on-boarding volunteers. They don't know what Food Rescue Alliance is, why are
they getting an email from this random org? They were confused when they find
out its the Rootable email, and often it went to their spam folder. Previously,
updating the email was a code change which made the process of changing it
difficult. Also, if another organizations self-hosted Rootable, it wasn't be
easy for them to discover and update the email address accordingly.

So this is now configurable via an env variable. The env variable sets
Rails.config.smtp_sender_address, which in turn sets Devise's
config.mailer_sender. The config.mailer_sender is set as a lambda because
then it can be overridden for tests.

We also considered letting each org control where email is sent from. However,
we'd have to verify every org's domain which is a bit bigger than this task.
Perhaps in the future.

When an organization or a user got an invite or alert from Rootable, it was from "software@foodrescuealliance.org." This has caused a lot of confusions when on-boarding volunteers. They don't know what Food Rescue Alliance is, why are they getting an email from this random org? They were confused when they find out its the Rootable email, and often it went to their spam folder. Previously, updating the email was a code change which made the process of changing it difficult. Also, if another organizations self-hosted Rootable, it wasn't be easy for them to discover and update the email address accordingly. So this is now configurable via an env variable. The env variable sets `Rails.config.smtp_sender_address`, which in turn sets Devise's `config.mailer_sender`. The `config.mailer_sender` is set as a lambda because then it can be overridden for tests. We also considered letting each org control where email is sent from. However, we'd have to verify every org's domain which is a bit bigger than this task. Perhaps in the future.
The styles were only applied to new forms. Oops.
thetizzo approved these changes 2026年01月21日 18:33:05 +01:00
Dismissed
thetizzo left a comment
Copy link

Looks good. Just one non-blocking comment.

Looks good. Just one non-blocking comment.
@ -50,0 +50,4 @@
config.smtp_sender_address = ENV.fetch(
"SMTP_SENDER_ADDRESS",
"Food Rescue Alliance <software@foodrescuealliance.org>"
)
First-time contributor
Copy link

I wonder if we should avoid having a default here. In the case of another organization running this, I think we would want to have this default to a missing config and raise an error on boot so that they don’t end up accidentally using the default value in their production app.

I wonder if we should avoid having a default here. In the case of another organization running this, I think we would want to have this default to a missing config and raise an error on boot so that they don’t end up accidentally using the default value in their production app.
Author
Owner
Copy link

Yeah, I like this, thanks. I did specify it in the "required for deployment" section of the readme, and it forced me move dotenv-rails into the development and test gem groups (should have done this forever ago).

Yeah, I like this, thanks. I did specify it in the "required for deployment" section of the readme, and it forced me move `dotenv-rails` into the development and test gem groups (should have done this forever ago).
edwardloveall force-pushed el-email-sender-config from d2a4b959d5
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
to 1f0fce0dcd
All checks were successful
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Successful
2026年01月21日 22:52:28 +01:00
Compare
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!73
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-email-sender-config"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?