Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined local variable or method `from_address' for Spree::UserMailer #97

Closed
njpearman opened this issue May 28, 2013 · 2 comments
Closed

Comments

@njpearman
Copy link

Hi,

I am getting a "undefined local variable or method `from_address' for #Spree::UserMailer" error when I try to send password resets from spree_auth_devise in my Spree application.

I have the following gems defined in my Gemfile:

gem 'deface', github: 'spree/deface'
gem 'spree', :github => 'spree/spree', :branch => '1-3-stable'
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '1-3-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'

Looking at the implementation in Spree:UserMailer, it would seem that the Spree::BaseMailer isn't available to the UserMailer when the UserMailer is loaded, but I'm too new to this code base to know where to start looking to fix it.

Any suggestions for fixing it?

Thanks,
Neill

@huoxito
Copy link
Member

huoxito commented May 28, 2013

hey @njpearman I've submitted a fix for that. Another possible solution, you could decorate that mailer to add a from_address method. That method could return either a string with a valid email or an array of emails.

@njpearman
Copy link
Author

Hi @huoxito. Thanks for the suggestions. I've actually already done the decorator 'fix', but seems a bit unsatisfactory as it's just redefining the functionality from the BaseMailer.

Thanks for submitting a more complete fix. I'll try it out when I get the chance over the nest day or so, but I need to get a store finished first!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants