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 contact email #149

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/includes/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= link_to t('.home'), root_path %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.contact'), "mailto:[email protected]" %>
<%= link_to t('.contact'), "mailto:#{Settings.instance.contact_email}" %>
</li>
<li class="mt-3 mt-sm-2">
<%= link_to t('.stories'), stories_path %>
Expand Down
17 changes: 17 additions & 0 deletions config/initializers/settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The Settings class is a singleton class which holds all configuration
# which is accessed throughout the application outside of `config` files.
# These settings mostly include environemt variables and other global settings.
#
# Similar pattern and inspiration from:
# https://garrettdimon.com/journal/posts/unified-configuration-in-rails
#
# Usage: Settings.instance.contact_email
#

class Settings
include Singleton

def contact_email
ENV["DOMAIN_EMAIL_ADDRESS"]
end
end