Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

#1017 request email links #1024

Merged
merged 4 commits into from
Oct 27, 2014
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Reservations ships with the default config time set to Eastern Time (US and Cana


You will need to also configure the email config in
`config/initializers/setup_mail.rb`. Replace `0.0.0.0:3000` with the
`config/environments/production.rb`. Replace `example.com` with the
relevant hostname. This will allow links in emails to point to the
correct places.

Expand Down
12 changes: 6 additions & 6 deletions app/views/admin_mailer/request_filed.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p>A new reservation request has been filed by
<%= link_to @reservation.reserver.name, @reservation.reserver %></p>
<%= link_to @reservation.reserver.name, user_url(@reservation.reserver, only_path: false) %></p>
<ul>
<li>Equipment requested: <%= link_to @reservation.equipment_model.name, @reservation.equipment_model %> </li>
<li>Requested start date: <%= @reservation.start_date.to_date.to_s(:long) %></li>
<li>Requested end date: <%= @reservation.due_date.to_date.to_s(:long) %></li>
<li>Notes: <%= @reservation.notes %></li>
<li>Equipment requested: <%= link_to @reservation.equipment_model.name, equipment_model_url(@reservation.equipment_model, only_path: false) %> </li>
<li>Requested start date: <%= @reservation.start_date.to_date.to_s(:long) %></li>
<li>Requested end date: <%= @reservation.due_date.to_date.to_s(:long) %></li>
<li>Notes: <%= @reservation.notes %></li>
</ul>
<p>Click <%= link_to "here", review_request_path(@reservation) %> to review this request</p>
<p>Click <%= link_to "here", review_request_url(@reservation, only_path: false) %> to review this request</p>

1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# Use letter_opener for development mail testing
config.action_mailer.delivery_method = ENV['USER'] == 'vagrant' ? :letter_opener_web : :letter_opener
config.action_mailer.default_url_options = { host: "localhost:3000" }

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
Expand Down
4 changes: 4 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# Enable threaded mode
# config.threadsafe!

# mailer host: replace 'example.com' with your root url
# this will allow links in email text to function correctly
config.action_mailer.default_url_options = { host: "example.com" }

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
Expand Down
1 change: 1 addition & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { host: "localhost:3000" }

# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
Expand Down
6 changes: 1 addition & 5 deletions config/initializers/setup_mail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@
#:password => "password",
:enable_starttls_auto => true

}

# mailer host: replace "0.0.0.0:3000" with your root url in production
# this will allow links in e-mail text to function correctly
ActionMailer::Base.default_url_options[:host] = "0.0.0.0:3000"
}