如果我使用 deliver_later 方法,是否需要使用 ActiveJob 发送电子邮件?
Is necessary send email with ActiveJob if I'm using deliver_later method?
如果我使用 deliver_later
方法发送异步电子邮件,我是否需要生成 ActiveJob
class 以便稍后执行?
如果您正在使用 deliver_later
,则无需创建 ActiveJob class,因为 Action 邮件程序已与 ActiveJob 集成,电子邮件将通过异步方式发送默认队列 mailers
。但是如果你想要 运行 特定的方法,那么你可以创建 ActiveJob class 并使用 perform_later
.
参考:
http://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer
如果使用perform_later
创建工作:
http://edgeguides.rubyonrails.org/active_job_basics.html#create-the-job
如果我使用 deliver_later
方法发送异步电子邮件,我是否需要生成 ActiveJob
class 以便稍后执行?
如果您正在使用 deliver_later
,则无需创建 ActiveJob class,因为 Action 邮件程序已与 ActiveJob 集成,电子邮件将通过异步方式发送默认队列 mailers
。但是如果你想要 运行 特定的方法,那么你可以创建 ActiveJob class 并使用 perform_later
.
参考:
http://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer
如果使用perform_later
创建工作:
http://edgeguides.rubyonrails.org/active_job_basics.html#create-the-job