Add user feedback mailer
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user