-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config for notifications from email address & requiring name and/…
…or subject.
- Loading branch information
Showing
23 changed files
with
267 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -2,3 +2,4 @@ | ||
--format=nested | --format=nested | ||
--backtrace | --backtrace | ||
--profile | --profile | ||
--order random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,9 +1,9 @@ | |||
class ContactUs::ContactMailer < ActionMailer::Base | class ContactUs::ContactMailer < ActionMailer::Base | ||
def contact_email(contact) | def contact_email(contact) | ||
@message = contact.message | @contact = contact | ||
|
|
||
mail :from => contact.email, | mail :from => (ContactUs.mailer_from || contact.email), | ||
:subject => t('contact_us.contact_mailer.contact_email.subject', :email => contact.email), | :subject => (ContactUs.require_subject ? @contact.subject : t('contact_us.contact_mailer.contact_email.subject', :email => contact.email)), | ||
:to => ContactUs.mailer_to | :to => ContactUs.mailer_to | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,3 @@ | |||
<p><%= @message %></p> | <p><%= @contact.message %></p> | ||
<p>---------------------</p> | <p>---------------------</p> | ||
<p><%= t('.sent_by_contact_form') %></p> | <p><%= ContactUs.require_name ? t('.sent_by_name', :email => @contact.email, :name => @contact.name) : t('.sent_by_contact_form', :email => @contact.email) %></p> |
4 changes: 2 additions & 2 deletions
4
app/views/contact_us/contact_mailer/contact_email.text.plain.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
<%= @message %> | <%= @contact.message %> | ||
|
|
||
------------------------------------- | ------------------------------------- | ||
<%= t('.sent_by_contact_form') %> | <%= ContactUs.require_name ? t('.sent_by_name', :email => @contact.email, :name => @contact.name) : t('.sent_by_contact_form', :email => @contact.email) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,8 @@ | |||
<h2><%= t('.contact_us') %></h2> | <h2><%= t('.contact_us') %></h2> | ||
<%= semantic_form_for @contact, :url => contacts_path do |f| %> | <%= semantic_form_for @contact, :url => contacts_path do |f| %> | ||
<%= f.input :name, :label => t('.name') if ContactUs.require_name %> | |||
<%= f.input :email, :label => t('.email') %> | <%= f.input :email, :label => t('.email') %> | ||
<%= f.input :subject, :label => t('.subject') if ContactUs.require_subject %> | |||
<%= f.input :message, :as => :text, :label => t('.message') %> | <%= f.input :message, :as => :text, :label => t('.message') %> | ||
<%= f.commit_button t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %> | <%= f.commit_button t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %> | ||
<% end %> | <% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,22 @@ | |||
# Use this hook to configure contact mailer. | # Use this hook to configure contact mailer. | ||
ContactUs.setup do |config| | ContactUs.setup do |config| | ||
|
|||
# ==> Mailer Configuration | # ==> Mailer Configuration | ||
# Configure the e-mail address which will be shown in ContactMailer. |
|
||
# Configure the e-mail address which email notifications should be sent from. If emails must be sent from a verified email address you may set it here. | |||
# Example: | |||
# config.mailer_from = "contact@please-change-me.com" | |||
config.mailer_from = nil | |||
|
|||
# Configure the e-mail address which should receive the contact form email notifications. | |||
config.mailer_to = "contact@please-change-me.com" | config.mailer_to = "contact@please-change-me.com" | ||
|
|||
# ==> Form Configuration | |||
|
|||
# Configure the form to ask for the users name. | |||
config.require_name = false | |||
|
|||
# Configure the form to ask for a subject. | |||
config.require_subject = false | |||
|
|||
end | end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.