Commit 46ab2858 authored by David F.'s avatar David F.
Browse files

Merge branch '106-ameliorer-l-envoi-des-mails-du-formulaire-de-contact' into 'master'

Default mail from for contact us mails: refs #106.

See merge request !105
parents 4cb5d6a7 f0cd15e4
...@@ -34,3 +34,5 @@ GRETEL_TRAILS_SECRET='gretel_secret' ...@@ -34,3 +34,5 @@ GRETEL_TRAILS_SECRET='gretel_secret'
# Google service account Oauth 2.0 client ID for Google # Google service account Oauth 2.0 client ID for Google
# Calendar synchronization # Calendar synchronization
# GOOGLE_CLIENT_ID='' # GOOGLE_CLIENT_ID=''
# Mainly used for ContactUs mails (usefull for SPF and DKIM)
# DEFAULT_MAIL_FROM=www@domain.tld
...@@ -24,8 +24,9 @@ class Mailer < ActionMailer::Base ...@@ -24,8 +24,9 @@ class Mailer < ActionMailer::Base
def contact_us(email, sent_at = Time.now) def contact_us(email, sent_at = Time.now)
@mail = email @mail = email
mail :from => @mail.email, mail :from => ENV['DEFAULT_MAIL_FROM'],
:to => Settings.instance.contact_email, :to => Settings.instance.contact_email,
:reply_to => @mail.email,
:subject => @mail.subject, :subject => @mail.subject,
:date => sent_at :date => sent_at
end end
......
...@@ -45,4 +45,7 @@ describe Mailer do ...@@ -45,4 +45,7 @@ describe Mailer do
expect(@mail.body.encoded).to match("Voici les...") expect(@mail.body.encoded).to match("Voici les...")
end end
end end
pending "TODO: contact_us"
pending "TODO: reset_password"
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment