开发者

Rails - Devise lag when sending welcome email

I send a welcome email to a user after he was create using the following code in my model:

after_create :send_welcome_email
...

def send_welcome_email
  EmailerUtilizator.welcome_email(self).deliver
end
开发者_StackOverflow社区

I do this with an ajax call, the delived method has a short but noticeable delay. Shall I use an async method ? Or shall I use some sort of waiting animation ?

Thank you,


Perhaps combine with delayed_job? If they receive an email in 2-3 minutes even it's acceptable and also consider the scenario of concurrent registrations!

def send_welcome_email
  EmailerUtilizator.delay.welcome_email(self)
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜