Ask A Question


You’re not receiving notifications from this thread.

how can i pass mailer_name into a method using noticed gem

zunaira ihsan asked in Ruby

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

def email_name


Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 73,895+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.