我正在开发一个 Redmine 插件并尝试通过循环向多个用户发送电子邮件,但问题是当我使用它时,它只向最后一个用户发送电子邮件。已将代码相同。请帮忙。
def leave_request(receivers)
receivers.each do |receiver|
test = User.find_by_id(receiver)
mail(to: test.mail, subject: 'Welcome to ABC Leave application module')
end
end