Answer the question
In order to leave comments, you need to log in
How to configure devise so that you can send “regular” emails?
There is a configured devise, letters with account confirmation, password recovery are sent. There is a "regular" email that was normally sent before the devise was installed:
class ServiceMailer < ApplicationMailer
default :from => '[email protected]'
def notify_record(service_mail, record)
@record = record
mail(to: service_mail, subject: 'Новая запись')
end
end
class RecordsController < InheritedResources::Base
respond_to :json
protect_from_forgery :except => :create
def create
# pp params
r = Record.create(:name => params[:fio], :phone => params[:phone], :date => params[:date], :job_id => params[:job], :address_id => params[:address])
ServiceMailer.notify_record(
Service.joins(:addresses).where(:addresses => {:id => params[:address]}).first.email,
r
).deliver_now
render :json => {}, :status => 200
end
end
Net::SMTPFatalError (553 5.7.1 Sender address rejected: not owned by auth user
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question