Skip to content

Commit

Permalink
disjonction host url for mailers depending on environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelfaure committed Oct 19, 2023
1 parent 304d82a commit 03db348
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/mailers/api_entreprise_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
class APIEntrepriseMailer < ApplicationMailer
default from: 'support@entreprise.api.gouv.fr'
default_url_options[:host] = 'https://entreprise.api.gouv.fr'

default_url_options[:host] = if Rails.env.sandbox? || Rails.env.staging?
"https://#{Rails.env}.entreprise.api.gouv.fr"
else
'https://entreprise.api.gouv.fr'
end
end
7 changes: 6 additions & 1 deletion app/mailers/api_particulier_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
class APIParticulierMailer < ApplicationMailer
default from: 'support@particulier.api.gouv.fr'
default_url_options[:host] = 'https://particulier.api.gouv.fr'

default_url_options[:host] = if Rails.env.sandbox? || Rails.env.staging?
"https://#{Rails.env}.particulier.api.gouv.fr"
else
'https://particulier.api.gouv.fr'
end
end

0 comments on commit 03db348

Please sign in to comment.