aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/contact_mailer/add_public_body.text.erb5
-rw-r--r--app/views/contact_mailer/update_public_body_email.text.erb5
-rw-r--r--config/application.rb6
-rw-r--r--spec/controllers/public_body_change_requests_controller_spec.rb4
4 files changed, 20 insertions, 0 deletions
diff --git a/app/views/contact_mailer/add_public_body.text.erb b/app/views/contact_mailer/add_public_body.text.erb
index 7c7978e7a..5baa1fa1a 100644
--- a/app/views/contact_mailer/add_public_body.text.erb
+++ b/app/views/contact_mailer/add_public_body.text.erb
@@ -12,3 +12,8 @@
<%= _("Notes:") %>
<%= @change_request.notes %>
+<%= _('Add the authority:') %>
+<%= admin_body_new_url(:change_request_id => @change_request.id, :only_path => false ) %>
+
+<%= _('Close the request and respond:') %>
+<%= admin_change_request_edit_url(:id => @change_request.id, :only_path => false ) %>
diff --git a/app/views/contact_mailer/update_public_body_email.text.erb b/app/views/contact_mailer/update_public_body_email.text.erb
index db494b92c..7d5a3dae0 100644
--- a/app/views/contact_mailer/update_public_body_email.text.erb
+++ b/app/views/contact_mailer/update_public_body_email.text.erb
@@ -9,3 +9,8 @@
<%= _("Notes:") %>
<%= @change_request.notes %>
+<%= _('Update the address:') %>
+<%= admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id, :only_path => false) %>
+
+<%= _('Close the request and respond:') %>
+<%= admin_change_request_edit_url(:id => @change_request.id, :only_path => false ) %>
diff --git a/config/application.rb b/config/application.rb
index 3c749a531..cbc7b9413 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -77,6 +77,12 @@ module Alaveteli
require "#{Rails.root}/lib/whatdotheyknow/strip_empty_sessions"
config.middleware.insert_before ::ActionDispatch::Cookies, WhatDoTheyKnow::StripEmptySessions, :key => '_wdtk_cookie_session', :path => "/", :httponly => true
+ # Allow the generation of full URLs in emails
+ config.action_mailer.default_url_options = { :host => AlaveteliConfiguration::domain }
+ if AlaveteliConfiguration::force_ssl
+ config.action_mailer.default_url_options[:protocol] = "https"
+ end
+
# Enable the asset pipeline
config.assets.enabled = true
diff --git a/spec/controllers/public_body_change_requests_controller_spec.rb b/spec/controllers/public_body_change_requests_controller_spec.rb
index 00d9c7d40..7b878b893 100644
--- a/spec/controllers/public_body_change_requests_controller_spec.rb
+++ b/spec/controllers/public_body_change_requests_controller_spec.rb
@@ -36,6 +36,8 @@ describe PublicBodyChangeRequestsController, "creating a change request" do
mail.body.should include('new_body@example.com')
mail.body.should include('New Body')
mail.body.should include("Please")
+ mail.body.should include('http://test.host/admin/body/new?change_request_id=')
+ mail.body.should include('http://test.host/admin/change_request/edit/')
end
it 'should show a notice' do
@@ -76,6 +78,8 @@ describe PublicBodyChangeRequestsController, "creating a change request" do
mail.body.should include('new_body@example.com')
mail.body.should include(@public_body.name)
mail.body.should include("Please")
+ mail.body.should include("http://test.host/admin/body/edit/#{@public_body.id}?change_request_id=")
+ mail.body.should include('http://test.host/admin/change_request/edit/')
end
it 'should show a notice' do