Add user feedback mailer
This commit is contained in:
@@ -126,7 +126,8 @@ class UserController < Users::ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def feedback
|
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: {}
|
render json: {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,10 @@ class Notifier < ActionMailer::Base
|
|||||||
I18n.locale = :en
|
I18n.locale = :en
|
||||||
mail to: "bterkuile+mozo-contact-form@gmail.com", subject: "[CONTACTFORM] new entry"
|
mail to: "bterkuile+mozo-contact-form@gmail.com", subject: "[CONTACTFORM] new entry"
|
||||||
end
|
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
|
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 = {
|
config.action_mailer.default_url_options = {
|
||||||
host: 'www.mozo.bar'
|
host: 'www.mozo.bar'
|
||||||
}
|
}
|
||||||
config.action_mailer.smtp_settings = {
|
|
||||||
address: "smtp.gmail.com",
|
config.action_mailer.delivery_method = :sendmail
|
||||||
port: 587,
|
#config.action_mailer.smtp_settings = {
|
||||||
domain: "mozo.bar",
|
#address: "smtp.gmail.com",
|
||||||
authentication: :plain,
|
#port: 587,
|
||||||
user_name: "bterkuile@companytools.nl",
|
#domain: "mozo.bar",
|
||||||
password: "BjTKct22",
|
#authentication: :plain,
|
||||||
enable_starttls_auto: true
|
#user_name: "bterkuile@companytools.nl",
|
||||||
}
|
#password: "BjTKct22",
|
||||||
|
#enable_starttls_auto: true
|
||||||
|
#}
|
||||||
|
|
||||||
# Enable threaded mode
|
# Enable threaded mode
|
||||||
# config.threadsafe!
|
# config.threadsafe!
|
||||||
|
|||||||
Reference in New Issue
Block a user