Skip to content

Commit a783d77

Browse files
committed
Docs for ActionMailer
1 parent 57fe6ed commit a783d77

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ class ApplicationJob < ActiveJob::Base
4545
end
4646
```
4747

48+
Using ActionMailer's built-in deliver job with ActiveJob? Make sure to include the Lambdakiq worker and set the queue name depending on your Rails version.
49+
50+
```ruby
51+
# Rails 5.x
52+
ActionMailer::DeliveryJob.include Lambdakiq::Worker
53+
ActionMailer::DeliveryJob.queue_as ENV['JOBS_QUEUE_NAME']
54+
# Rails 6.x
55+
ActionMailer::MailDeliveryJob.include Lambdakiq::Worker
56+
ActionMailer::MailDeliveryJob.queue_as ENV['JOBS_QUEUE_NAME']
57+
```
58+
4859
The same Docker image will be used for both your `web` and `jobs` functions (example setup in following sections) which means the same `app.rb` handler would be used. The [Lamby](https://lamby.custominktech.com) gem automatically detects if Lambdakiq is being used so the following handler works as is.
4960

5061
```ruby

0 commit comments

Comments
 (0)