So, my client said that many of the letters go to the wrong person, and I would like to write some functional tests to find and make sure that they receive the letter and what it says in my specifications. I have a mandrill_mailer that uses the mandril api, and before sending it I would like to see what the message is.
For example. Create a new user account -> create a user, and then send a welcome email. in development, it calls RegistrationMailer.new_registration (resource) .deliver which then sends an email to the user:
def new_registration(user) user = User.find_by_email(user["email"]) mandrill_mail template: 'new-registration', subject: 'Welcome to ContentBlvd!', to: { email: user["email"], name: user["full_name"] }, vars: { 'first_name' => user["full_name"], 'unsubscribe' => "#{CONFIG[:protocol]}#{CONFIG[:host]}/unsubscribe?email=#{user.email}" }
end
In my mail program, how can I check this mail object?
I tried ActionMailer :: Base.deliveries, but it returns nil (Since I use mandrill handwriting ...) So I tried - MandrillMailer :: TemplateMailer.message But no luck ... Thanks for the help.
email ruby-on-rails rspec devise mandrill
tspore
source share