Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Handling of contact_us_url in def app_email #3386

Open
aaronskiba opened this issue Feb 13, 2024 · 0 comments
Open

Update Handling of contact_us_url in def app_email #3386

aaronskiba opened this issue Feb 13, 2024 · 0 comments

Comments

@aaronskiba
Copy link
Contributor

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

  • 4.1.1

Description

  • The value for contact_us_url is set via the contact_us gem. If we want to define a custom value for this, the codebase also allows us to do so via Rails.application.config.x.organisation.contact_us_url.
  • Throughout the codebase, there are many statements similar to the following:
    contact_us = Rails.configuration.x.organisation.contact_us_url || contact_us_url
  • However, there is one exception to this in app/services/extermal_apis/base_service.rb:
      def app_email
        dflt = Rails.application.routes.url_helpers.contact_us_url || ''
        Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)
      end
  • The problem here is that, like contact_us_url, the value for Rails.application.routes.url_helpers.contact_us_url is is set via the contact_us gem. If we again want allow for a custom defined valued, then maybe we should change the code to the following:
      def app_email
        dflt = Rails.configuration.x.organisation.contact_us_url || contact_us_url
        Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)
      end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant