Skip to content

Commit

Permalink
Merge pull request #184 from sparc-request/jw_sparc_id_in_subject_line
Browse files Browse the repository at this point in the history
added protocol id to subject line of service provider emails.  Also a…
  • Loading branch information
jwiel86 committed Oct 30, 2015
2 parents f55e7f9 + f316f15 commit f263c16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/mailers/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def notify_service_provider service_provider, service_request, attachments_to_ad

# only send these to the correct person in the production env
email = Rails.env == 'production' ? service_provider.identity.email : DEFAULT_MAIL_TO
subject = Rails.env == 'production' ? "#{I18n.t('application_title')} service request" : "[#{Rails.env.capitalize} - EMAIL TO #{service_provider.identity.email}] #{I18n.t('application_title')} service request"
subject = Rails.env == 'production' ? "#{@protocol.id} - #{I18n.t('application_title')} service request" : "#{@protocol.id} - [#{Rails.env.capitalize} - EMAIL TO #{service_provider.identity.email}] #{I18n.t('application_title')} service request"

mail(:to => email, :from => NO_REPLY_FROM, :subject => subject)
end
Expand Down
3 changes: 3 additions & 0 deletions spec/mailers/notifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@
expect(mail).to have_xpath("//th[text()='Service']/following-sibling::th[text()='Action']")
expect(mail).to have_xpath("//td[text()='#{service.name}']/following-sibling::td[text()='Removed']")
end
it "should have the correct subject" do
expect(mail).to have_subject("#{service_request.protocol.id} - [Test - EMAIL TO glennj@musc.edu] SPARC Request service request")
end
end
end

Expand Down

0 comments on commit f263c16

Please sign in to comment.