Im trying to override devise in order to send mail to activate a user. In the create method in the registrations controller i have this
urlEmail = resource.email.sub('@','-')
Pony.mail(
:to => resource.email,
:from => "[email protected]",
:subject => "Confirm Account",
:headers => { 'Content-Type' => 'text/html' },
:body => ("<h1>Welcome To My Awesome Site</h1>
<p>follow this link to create your account</p>
<p>http://localhost:3000/confirm-me/stuff?=" + resource.confirmhash.to_s + "/" + urlEmail.to_s + "</p>") )
This url leads to a method to activate the user. Whether this is a good way to confirm an account is beside the point. The problem is that when the Pony.mail(...) runs i get this error
uninitialized constant RegistrationsController::Pony
i have installed pony and Pony.mail works in the console. I also tried using require 'pony' in the top of the controller file but i get
no such file to load -- pony
What do i need to do to make this work.
It's look like problem with bundler. Do you run console in the same RAILS_ENV as your controller test?
Try to copy pony.rb to your lib (from https://github.com/benprew/pony) and require it on the top of controller file. Remove gem "pony" from your Gemfile. bundle install. Make a test.
If its help, go back to bundler, remove Gemfile.lock and run bundle install.
If still have this problem include your Gemfile here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With