Add user feedback mailer

This commit is contained in:
2015-10-02 17:26:06 +02:00
parent b49ed8c64d
commit 79eb85a68f
4 changed files with 24 additions and 10 deletions
+2 -1
View File
@@ -126,7 +126,8 @@ class UserController < Users::ApplicationController
end
def feedback
UserFeedback.create(user_id: current_user.id, content: params[:feedback].to_s)
user_feedback = UserFeedback.create(user_id: current_user.id, content: params[:feedback].to_s)
Notifier.user_feedback(user_feedback).deliver_later
render json: {}
end
+6
View File
@@ -7,4 +7,10 @@ class Notifier < ActionMailer::Base
I18n.locale = :en
mail to: "bterkuile+mozo-contact-form@gmail.com", subject: "[CONTACTFORM] new entry"
end
def user_feedback(feedback)
@user_feedback = feedback
I18n.locale = :en
mail to: "bterkuile+mozo-user-feedback@gmail.com", subject: "[MOZO][USER-FEEDBACK] New user feedback"
end
end
@@ -0,0 +1,5 @@
h3 New feedback received:
b User info
pre= @user_feedback.user.try(:attributes).try(:to_yaml)
b Feedback info
pre= @user_feedback.content
+11 -9
View File
@@ -64,15 +64,17 @@ Qwaiter::Application.configure do
config.action_mailer.default_url_options = {
host: 'www.mozo.bar'
}
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "mozo.bar",
authentication: :plain,
user_name: "bterkuile@companytools.nl",
password: "BjTKct22",
enable_starttls_auto: true
}
config.action_mailer.delivery_method = :sendmail
#config.action_mailer.smtp_settings = {
#address: "smtp.gmail.com",
#port: 587,
#domain: "mozo.bar",
#authentication: :plain,
#user_name: "bterkuile@companytools.nl",
#password: "BjTKct22",
#enable_starttls_auto: true
#}
# Enable threaded mode
# config.threadsafe!