Last active
December 14, 2015 07:19
-
-
Save aalvesjr/5049575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MailerWorker | |
include Qe::Worker | |
def perform | |
# ChangePasswordMailer.public_send(options[:mail], options).deliver # da erro que nil não pode ser enviado ao public_send | |
ChangePasswordMailer.public_send(options["mail"], options).deliver | |
end | |
end | |
class ChangePasswordMailer < ActionMailer::Base | |
def new_password_mail(options) | |
@usuario = options["name"] | |
@subject = options["subject"] || "Nova senha para acesso ao GVAR" | |
mail(:to => options["email"], :subject => @subject) | |
end | |
end | |
# e no controller: | |
MailerWorker.enqueue({ | |
:mail => :new_password_mail, | |
:name => user.name, | |
:email => user.email | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment