Reputation: 321
I have a Rails 4.2 app using ActiveJob/ActionMailer and Sidekiq/Redis with Devise for authentication. I require email confirmations when signing up, which is handled by Devise. I'm running into an issue when users sign up, but the confirmation email sometimes doesn't get sent.
The logs show that the confirmation email is enqueued by ActiveJob, and sometimes it gets processed, sometimes it does not. When the confirmation email isn't processed, and the user requests for it again, the new confirmation email goes through.
Any ideas as to why this is happening?
Also, I am not iterating over any users, I'm using the standard Devise sign up process. So this doesn't apply.
Upvotes: 0
Views: 114
Reputation: 321
I think I know the reason for the inconsistent emails. I had two separate staging environments using the same redis server instance. For the sake of explanation I will call them staging1 and staging2.
I believe what was happening was that when a user (ID=1) was being created on staging2, sometimes staging1 would be processing the email for its own user (ID=1), and so the user from staging2 would not get the email, but rather the email was being sent to the user from staging1.
To resolve this issue, one of two things can be done.
Upvotes: 0