I am trying to create a method that, when called send a email to all users.
My ultimate goal is to call this method via a scheduler (i already got the scheduler work
For each call to the mailer method one email is sent
in scheduled worker
def calling_method @users.each do |user| send_digest(user.email, user.name) end end
in user mailer
def send_digest(user_email, user_name) mail(to: user_email, subject: user_name) end