Closed philipithomas closed 3 years ago
Hey @philipithomas, you probably want to use something like EmailAddress.find_by(email: message.to.first)
instead of EmailAddress.first
. You can also try removing the rescue
in development to see if there are any errors.
Hey - yes, I had done that filtering originally, but I don't believe the code is executing at all. (I even through a byebug
in there that didn't execute). So, my more overarching question is - what's the correct way to replace the user identification function?
I can do more debugging later to investigate further.
AhoyEmail.default_options[:user]
is the way - https://github.com/ankane/ahoy_email#options
Thank you! The issue seemed to be that I was using a proc
in instead of a lambda
. I'm new to ruby, so I don't know well why this is the case - but I got the code working!
Hi,
I have a one-to-many association between users and email addresses. So, I need to update the way AhoyEmail detects what it considers a "user".
In
config/initializers/ahoy_email.rb
I have this code:However, it doesn't seem to be working.
How should the user detection query get updated globally?
(And thanks for the help! 🙏)