diff --git a/app/mailers/task_mailer.rb b/app/mailers/task_mailer.rb index 604b262c4..cb5eec11e 100644 --- a/app/mailers/task_mailer.rb +++ b/app/mailers/task_mailer.rb @@ -8,6 +8,8 @@ class TaskMailer < ApplicationMailer def task_confirmation(identity, task) @identity = identity @task = task - mail to: identity.email, subject: "(SPARCFulfillment) New Task Assigned" + env = ENV.fetch('ENVIRONMENT') + test_email = ENV.fetch('TESTING_EMAIL') + mail to: env == 'testing' ? test_email : identity.email, subject: "(SPARCFulfillment) New Task Assigned" end end diff --git a/dotenv.example b/dotenv.example index d379b4792..d5e454c55 100644 --- a/dotenv.example +++ b/dotenv.example @@ -42,3 +42,5 @@ LDAP_AUTH_PASSWORD= # add the following line if EPIC is turned off for your institution USE_EPIC=false USE_INDIRECT_COST=false +ENVIRONMENT=testing +TESTING_EMAIL=sparcrequest@gmail.com