diff --git a/.env.sample b/.env.sample index 69aae3925..0d151e967 100644 --- a/.env.sample +++ b/.env.sample @@ -2,11 +2,9 @@ API_HTTP_USERNAME=username API_HTTP_PASSWORD=password # For AWS Simple Email Service -AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY-ID -AWS_SECRET_ACCESS_KEY=YOUR-AWS-SECRET-ACCESS-KEY -AWS_REGION= -AWS_SES_SMTP_USERNAME= -AWS_SES_SMTP_PASSWORD= +AWS_SES_ACCESS_KEY_ID= +AWS_SES_SECRET_ACCESS_KEY= +AWS_SES_REGION= # For Docker COMPOSE_PROJECT_NAME=touchpoints @@ -61,4 +59,3 @@ TOUCHPOINTS_SUPPORT=feedback-analytics@gsa.gov TOUCHPOINTS_TEAM=feedback-analytics@gsa.gov INDEX_URL=https://touchpoints.digital.gov/ - diff --git a/.env.test b/.env.test index 99b6503c7..e5233cb0b 100644 --- a/.env.test +++ b/.env.test @@ -1,9 +1,9 @@ API_HTTP_USERNAME=username API_HTTP_PASSWORD=password -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_REGION= +AWS_SES_ACCESS_KEY_ID= +AWS_SES_SECRET_ACCESS_KEY= +AWS_SES_REGION= INDEX_URL=/index diff --git a/config/environments/staging.rb b/config/environments/staging.rb index cec6c44ba..00ed181c7 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -106,7 +106,6 @@ config.action_controller.default_url_options = { host: ENV.fetch("TOUCHPOINTS_WEB_DOMAIN") } config.action_controller.asset_host = ENV.fetch("TOUCHPOINTS_WEB_DOMAIN") - # Temporarilty Disable Email Sending - config.action_mailer.delivery_method = :smtp + config.action_mailer.delivery_method = :ses config.action_mailer.perform_deliveries = true end diff --git a/config/initializers/amazon_ses.rb b/config/initializers/amazon_ses.rb new file mode 100644 index 000000000..5ed417dba --- /dev/null +++ b/config/initializers/amazon_ses.rb @@ -0,0 +1,5 @@ +Aws::Rails.add_action_mailer_delivery_method(:ses, + access_key_id: ENV['AWS_SES_ACCESS_KEY_ID'], + secret_access_key: ENV['AWS_SES_SECRET_ACCESS_KEY'], + region: ENV['AWS_SES_REGION'] +) diff --git a/manifest.sample.yml b/manifest.sample.yml index 85f1fe4e5..648b9c770 100644 --- a/manifest.sample.yml +++ b/manifest.sample.yml @@ -6,9 +6,9 @@ applications: env: # For AWS SES (Simple Email Service) - AWS_ACCESS_KEY_ID: - AWS_SECRET_ACCESS_KEY: - AWS_REGION: + AWS_SES_ACCESS_KEY_ID: + AWS_SES_SECRET_ACCESS_KEY: + AWS_SES_REGION: # DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 # DANGEROUS! NEW_RELIC_KEY: diff --git a/touchpoints-demo.yml b/touchpoints-demo.yml index 683a8baf8..2def7cbe9 100644 --- a/touchpoints-demo.yml +++ b/touchpoints-demo.yml @@ -2,9 +2,9 @@ applications: - name: touchpoints-demo command: bundle exec rake cf:on_first_instance db:migrate && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV env: - AWS_ACCESS_KEY_ID: - AWS_REGION: - AWS_SECRET_ACCESS_KEY: + AWS_SES_ACCESS_KEY_ID: + AWS_SES_SECRET_ACCESS_KEY: + AWS_SES_REGION: LOGIN_GOV_CLIENT_ID: urn:gov:gsa:openidconnect.profiles:sp:sso:gsa-tts-opp:touchpoints-demo LOGIN_GOV_IDP_BASE_URL: https://idp.int.identitysandbox.gov/ LOGIN_GOV_PRIVATE_KEY: diff --git a/touchpoints-staging.yml b/touchpoints-staging.yml index d7db46e05..ed344575d 100644 --- a/touchpoints-staging.yml +++ b/touchpoints-staging.yml @@ -2,9 +2,9 @@ applications: - name: touchpoints-staging command: bundle exec rake cf:on_first_instance db:schema:load && rake db:seed && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV env: - AWS_ACCESS_KEY_ID: - AWS_REGION: - AWS_SECRET_ACCESS_KEY: + AWS_SES_ACCESS_KEY_ID: + AWS_SES_SECRET_ACCESS_KEY: + AWS_SES_REGION: DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 LOGIN_GOV_CLIENT_ID: urn:gov:gsa:openidconnect.profiles:sp:sso:gsa-tts-opp:touchpoints-staging LOGIN_GOV_IDP_BASE_URL: https://idp.int.identitysandbox.gov/ diff --git a/touchpoints.yml b/touchpoints.yml index 0acd0e73d..27754bb2e 100644 --- a/touchpoints.yml +++ b/touchpoints.yml @@ -2,9 +2,9 @@ applications: - name: touchpoints command: bundle exec rake cf:on_first_instance db:migrate && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV env: - AWS_ACCESS_KEY_ID: - AWS_REGION: - AWS_SECRET_ACCESS_KEY: + AWS_SES_ACCESS_KEY_ID: + AWS_SES_SECRET_ACCESS_KEY: + AWS_SES_REGION: LOGIN_GOV_CLIENT_ID: urn:gov:gsa:openidconnect.profiles:sp:sso:gsa-tts-opp:touchpoints LOGIN_GOV_IDP_BASE_URL: https://secure.login.gov/ LOGIN_GOV_PRIVATE_KEY: