how can i pass mailer_name into a method using noticed gem
us = User.first
email = EmailDetail.find_by_name("Welcome User Email")
UserNotification.with(email_class: "UserMailer" , email: email.function_name).deliver(us)
i am trying to pass mailer name as a params and accessing this in my method
but keeps giving me error
undefined method `with' for "UserMailer":String
why i try to access it like this
class UserNotification < Noticed::Base
deliver_by :email, mailer: :mailer_name , method: :email_name
deliver_by :database
params :email
def mailer_name
"UserMailer"
end
def email_name
params[:email]
end
end