Skip to content

Commit

Permalink
Renamed env var
Browse files Browse the repository at this point in the history
GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID to GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID
  • Loading branch information
fumimowdan committed Sep 13, 2023
1 parent ed02af0 commit 074cd71
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PORT=3000
GOVUK_NOTIFY_API_KEY=
GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID=
GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=
AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
AZURE_TENANT_ID=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
COMMIT_SHA=${{ env.IMAGE_TAG }}
GOVUK_NOTIFY_API_KEY=${{ secrets.GOVUK_NOTIFY_API_KEY }}
GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID=${{ secrets.GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID }}
GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID=${{ secrets.GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID }}
GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=${{ secrets.GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID }}
- name: Push ${{ env.DOCKER_IMAGE }} images for review
if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
DATABASE_URL: 'postgres://rails:password@localhost:5432/rails_test'
GOVUK_NOTIFY_API_KEY: ${{ secrets.GOVUK_NOTIFY_API_KEY }}
GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID: ${{ secrets.GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID }}
GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID: ${{ secrets.GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID }}
GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID: ${{ secrets.GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ENV GOVUK_NOTIFY_API_KEY=$GOVUK_NOTIFY_API_KEY
ARG GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID
ENV GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID=$GOVUK_NOTIFY_APPLICATION_SUBMITTED_TEMPLATE_ID

ARG GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID
ENV GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID=$GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID
ARG GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID
ENV GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=$GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID

CMD bundle exec rails db:migrate && \
bundle exec rails server -b 0.0.0.0
2 changes: 1 addition & 1 deletion app/mailers/govuk_notify_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class GovukNotifyMailer < Mail::Notify::Mailer
def application_submission
@urn = params[:urn]
view_mail(
Rails.configuration.x.govuk_notify.mail_notify_template_id,
Rails.configuration.x.govuk_notify.generic_email_template_id,
to: params[:email],
subject: t("mailer.application_submission.subject"),
)
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class Application < Rails::Application
api_key: ENV.fetch("GOVUK_NOTIFY_API_KEY"),
}

config.x.govuk_notify.mail_notify_template_id = ENV.fetch("GOVUK_NOTIFY_MAIL_NOTIFY_TEMPLATE_ID")
config.x.govuk_notify.generic_email_template_id = ENV.fetch("GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID")
end
end

0 comments on commit 074cd71

Please sign in to comment.