Rails: How to check if an email is already enqueued -


how check email enqueued, im using active job:

ofert_approved_notifier = notifier.ofert_approved(@ofert.user, @ofert)    if ofert_approved_notifier.deliver_later(wait: 1.hour)       puts "email ofert_approved sent successfully"    else       puts "email ofert_approved not sent"    end 

as can see above, im sending email @ofert.user , delayed 1 hour before being sent, above code in controller action, want check if email enqueued @ofert.user, not want send same email same user if in queue.

is there way can check that?. thanks

delayed::job activerecord object can check if records exists.

delayed::job.where(...) 

look @ structure of stored records , find out how email workers stored , how find them email. luck!


Comments