diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index b1157c4..1c5a3bd 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -1,3 +1,9 @@ +<% + # Override the default Rails route helper for the contact_us page IF an alternate contact_us url was defined + # in the branding config file + contact_us = Rails.application.config.branding[:organisation][:contact_us_url] || contact_us_path +%> +
+ <%= _('All the best') %>
+
+ <%= _('The %{tool_name} team') %{:tool_name => tool_name} %>
+
+ <%= _('You may change your notification preferences on your profile page.') %> <%= _('Please do not reply to this email.') %> <%= raw(_('If you have any questions or need help, please contact us at %{helpdesk_email} or visit %{contact_us}') %{ :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us => link_to(contact_us, contact_us) }) %> +
\ No newline at end of file diff --git a/app/views/user_mailer/api_token_granted_notification.html.erb b/app/views/user_mailer/api_token_granted_notification.html.erb index 6177c46..02cdf93 100644 --- a/app/views/user_mailer/api_token_granted_notification.html.erb +++ b/app/views/user_mailer/api_token_granted_notification.html.erb @@ -2,8 +2,6 @@ tool_name = Rails.configuration.branding[:application][:name] username = @user.name api_documentation_url = Rails.configuration.branding[:application][:api_documentation_url] - helpdesk_email = Rails.configuration.branding[:organisation][:helpdesk_email] - contact_us_url = Rails.configuration.branding[:organisation][:contact_us_url] email_subject = _('Query or feedback related to %{tool_name}') %{ :tool_name => tool_name } %> <% FastGettext.with_locale FastGettext.default_locale do %> @@ -13,12 +11,5 @@<%= raw(_('You have been granted permission by your organisation to use our API. Your API token and instructions for using the API endpoints can be found at: %{link}') %{ :link => link_to(api_documentation_url, api_documentation_url) }) %>
-
- <%= _('All the best') %>
-
- <%= _('The %{tool_name} team') %{:tool_name => tool_name} %>
-
- <%= _('Please do not reply to this email.') %> <%= raw(_('If you have any questions or need help, please contact us at %{helpdesk_email} or visit %{contact_us_url}') %{ :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us_url => link_to(contact_us_url, contact_us_url) }) %> -
+ <%= render partial: 'email_signature', locals: { email_subject: email_subject } %> <% end %> \ No newline at end of file diff --git a/app/views/user_mailer/permissions_change_notification.html.erb b/app/views/user_mailer/permissions_change_notification.html.erb index 0987cdb..3f32fda 100644 --- a/app/views/user_mailer/permissions_change_notification.html.erb +++ b/app/views/user_mailer/permissions_change_notification.html.erb @@ -3,8 +3,6 @@ username = @user.name plan_title = @role.plan.title access = nil - helpdesk_email = Rails.configuration.branding[:organisation][:helpdesk_email] - contact_us_url = Rails.configuration.branding[:organisation][:contact_us_url] email_subject = _('Query or feedback related to %{tool_name}') %{ :tool_name => tool_name } access_level = @role.access_level() access_level_messages = Role.access_level_messages @@ -16,12 +14,5 @@<%= _('Your permissions relating to %{plan_title} have changed. You now have %{type} access. This means you can %{placeholder1} %{placeholder2}') %{ :plan_title => plan_title, :type => access_level_messages[access_level][:type], :placeholder1 => access_level_messages[access_level][:placeholder1], :placeholder2 => access_level_messages[access_level][:placeholder2] } %>
-
- <%= _('All the best') %>
-
- <%= _('The %{tool_name} team') %{:tool_name => tool_name} %>
-
- <%= _('You may change your notification preferences on your profile page.') %> <%= _('Please do not reply to this email.') %> <%= raw(_('If you have any questions or need help, please contact us at %{helpdesk_email} or visit %{contact_us_url}') %{ :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us_url => link_to(contact_us_url, contact_us_url) }) %> -
+ <%= render partial: 'email_signature', locals: { email_subject: email_subject } %> <% end %> diff --git a/app/views/user_mailer/sharing_notification.html.erb b/app/views/user_mailer/sharing_notification.html.erb index 2b55207..192adb7 100644 --- a/app/views/user_mailer/sharing_notification.html.erb +++ b/app/views/user_mailer/sharing_notification.html.erb @@ -2,8 +2,6 @@ tool_name = Rails.configuration.branding[:application][:name] user_email = @user.email link = url_for(action: 'show', controller: 'plans', id: @role.plan.id) - helpdesk_email = Rails.configuration.branding[:organisation][:helpdesk_email] - contact_us_url = Rails.configuration.branding[:organisation][:contact_us_url] email_subject = _('Query or feedback related to %{tool_name}') %{ :tool_name => tool_name } %> <% FastGettext.with_locale FastGettext.default_locale do %> @@ -16,13 +14,6 @@<%= raw(_('%{click_here} to accept the invitation, (or copy %{link} into your browser). If you don\'t want to accept the invitation, please ignore this email.') %{ :click_here => link_to(_('Click here'), link), :link => link }) %>
-
- <%= _('All the best') %>
-
- <%= _('The %{tool_name} team') %{:tool_name => tool_name} %>
-
- <%= _('Please do not reply to this email.') %> <%= raw(_('If you have any questions or need help, please contact us at %{helpdesk_email} or visit %{contact_us_url}') %{ :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us_url => link_to(contact_us_url, contact_us_url) }) %> -
+ <%= render partial: 'email_signature', locals: { email_subject: email_subject } %> <% end %> diff --git a/app/views/user_mailer/welcome_notification.html.erb b/app/views/user_mailer/welcome_notification.html.erb index a02da97..f97257d 100644 --- a/app/views/user_mailer/welcome_notification.html.erb +++ b/app/views/user_mailer/welcome_notification.html.erb @@ -2,15 +2,18 @@ tool_name = Rails.configuration.branding[:application][:name] username = @user.name helpdesk_email = Rails.configuration.branding[:organisation][:helpdesk_email] - contact_us_url = Rails.configuration.branding[:organisation][:contact_us_url] email_subject = _('Query or feedback related to %{tool_name}') %{ :tool_name => tool_name } + + # Override the default Rails route helper for the contact_us page IF an alternate contact_us url was defined + # in the branding config file + contact_us = Rails.application.config.branding[:organisation][:contact_us_url] || contact_us_url %> <% FastGettext.with_locale FastGettext.default_locale do %><%= _('Welcome to %{tool_name}, %{username}') %{ :tool_name => tool_name, :username => username } %>
- <%= raw(_('%{tool_name} will help you to develop your Data Management Plan. If you have any queries or feedback as you use the tool, please contact us at %{helpdesk_email} or visit %{contact_us_url}') %{ :tool_name => tool_name, :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us_url => link_to(contact_us_url, contact_us_url) }) %> + <%= raw(_('%{tool_name} will help you to develop your Data Management Plan. If you have any queries or feedback as you use the tool, please contact us at %{helpdesk_email} or visit %{contact_us}') %{ :tool_name => tool_name, :helpdesk_email => mail_to(helpdesk_email, helpdesk_email, subject: email_subject), :contact_us => link_to(contact_us, contact_us) }) %>
<%= _('All the best') %> diff --git a/config/application.rb b/config/application.rb index a498903..9e5c35c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -83,7 +83,7 @@ # Load Branded terminology (e.g. organization name, application name, etc.) config.branding = config_for(:branding).deep_symbolize_keys - + # The default visibility setting for new plans # organisationally_visible - Any member of the user's org can view, export and duplicate the plan # publicly_visibile - (NOT advisable because plans will show up in Public DMPs page by default) diff --git a/config/branding_example.yml b/config/branding_example.yml index a81af4c..a6a9683 100644 --- a/config/branding_example.yml +++ b/config/branding_example.yml @@ -9,6 +9,11 @@ copywrite_name: 'Curation Centre (CC)' email: 'tester@cc_curation_centre.org' helpdesk_email: 'someone@somewhere.com' + + # Warning: this value will be used to override the URl of the application's built-in contact form. It will + # replace the link in all email communications as well as the contact link in the page footer! + # + # Comment this line out if you want to use DMPRoadmap's built-in contact form. contact_us_url: 'https://somewhere.com/contact-us' application: diff --git a/config/initializers/contact_us.rb b/config/initializers/contact_us.rb index 3f12697..10d2997 100644 --- a/config/initializers/contact_us.rb +++ b/config/initializers/contact_us.rb @@ -27,4 +27,4 @@ # Set the following variable to true if you are using localized paths # e.g. /en/contact-us OR /fr/contact-us config.localize_routes = true -end +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index b270d3b..d494910 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -254,5 +254,4 @@ end end end - end