12 Tips of Christmas - 8 Send Emails with Sidekiq
To help ensure users get a fast experience within your application, one tool you can utilise is Sidekiq to process any sending of email you might be doing asynchronously.
To get started, just add the following line to your
Gemfile
You'll also need redis, so if you haven't got that installed run the following:
To run Sidekiq:
Sidekiq supports sending emails with
ActionMailer
off the bat, all you need to do is call delay
before your mailer method instead of using deliver
eg:
We can also call
delay_until
to delay the email send until a specified time.
All too easy
No comments:
Post a Comment