Skip to content

Commit dba149c

Browse files
setup postmark
1 parent 4882e40 commit dba149c

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

.env.local.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
GOOGLE_CLIENT_ID=GOOGLE_CLIENT_ID
99
GOOGLE_CLIENT_SECRET=GOOGLE_CLIENT_SECRET
1010
GITHUB_CLIENT_ID=GITHUB_CLIENT_ID
11-
GITHUB_CLIENT_SECRET=GITHUB_CLIENT_SECRET
11+
GITHUB_CLIENT_SECRET=GITHUB_CLIENT_SECRET
12+
13+
POSTMARK_API_TOKEN=POSTMARK_API_TOKEN

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ gem "rotp", "~> 6.3"
9898

9999
gem "rqrcode", "~> 3.1"
100100

101-
gem "dockerfile-rails", ">= 1.7", :group => :development
101+
gem "dockerfile-rails", ">= 1.7", group: :development
102102

103103
gem "pg", "~> 1.6"
104104

105105
gem "litestream", "~> 0.14.0"
106106

107-
gem "aws-sdk-s3", "~> 1.199", :require => false
107+
gem "aws-sdk-s3", "~> 1.199", require: false
108+
109+
gem "postmark-rails", "~> 0.22.1"

Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ GEM
398398
tailwind_merge
399399
tty-prompt (~> 0.23.1)
400400
zeitwerk
401+
postmark (1.25.1)
402+
json
403+
postmark-rails (0.22.1)
404+
actionmailer (>= 3.0.0)
405+
postmark (>= 1.21.3, < 2.0)
401406
pp (0.6.2)
402407
prettyprint
403408
prettyprint (0.2.0)
@@ -664,6 +669,7 @@ DEPENDENCIES
664669
omniauth-google-oauth2 (~> 1.2)
665670
pg (~> 1.6)
666671
plutonium
672+
postmark-rails (~> 0.22.1)
667673
propshaft
668674
puma (>= 5.0)
669675
rails (~> 8.0.1)

config/environments/production.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,9 @@
6060
# Set host to be used by links generated in mailer templates.
6161
config.action_mailer.default_url_options = {host: "hack25.devcongress.io"}
6262

63-
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
64-
config.action_mailer.smtp_settings = {
65-
user_name: "apikey",
66-
password: ENV["SENDGRID_API_KEY"],
67-
address: "smtp.sendgrid.net",
68-
port: 587,
69-
authentication: :plain,
70-
enable_starttls_auto: true
63+
config.action_mailer.delivery_method = :postmark
64+
config.action_mailer.postmark_settings = {
65+
api_token: ENV["POSTMARK_API_TOKEN"]
7166
}
7267

7368
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to

config/initializers/001_ensure_required_env.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
if Rails.env.production?
77
required_env_vars += %w[
8-
RAILS_MASTER_KEY
8+
RAILS_MASTER_KEY DATABASE_URL
9+
POSTMARK_API_TOKEN
10+
GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET
911
]
12+
# GITHUB_CLIENT_ID GITHUB_CLIENT_SECRET
1013
end
1114

1215
# Add additional env vars here

0 commit comments

Comments
 (0)