Skip to content
This repository has been archived by the owner on Nov 28, 2021. It is now read-only.

Compatibility with Spree 4.1 #53

Open
Jchan241 opened this issue Mar 25, 2020 · 11 comments
Open

Compatibility with Spree 4.1 #53

Jchan241 opened this issue Mar 25, 2020 · 11 comments

Comments

@Jchan241
Copy link

Need some help here 😕

Getting the error below when trying this gem out with spree 4.1, I've tried removing the dependencies but giving me a "NoMethodError in Spree::Admin::MailMethods#edit" for enable_mail_delivery preference not defined

Bundler could not find compatible versions for gem "spree_auth_devise":
In snapshot (Gemfile.lock):
spree_auth_devise (= 4.1.0)

In Gemfile:
spree_auth_devise (~> 4.1)

spree_mail_settings was resolved to 3.3.0, which depends on
  spree_auth_devise (< 4.0, >= 3.1.0)
@xu4wang
Copy link

xu4wang commented Apr 4, 2020

I have the same issue. Added spree_mail_settings to Gemfile:

gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings'

bundle update

Bundler could not find compatible versions for gem "spree_auth_devise":
In Gemfile:
spree_auth_devise (~> 4.1)

spree_mail_settings was resolved to 3.3.0, which depends on
  spree_auth_devise (>= 3.1.0, < 4.0)

@mvanio
Copy link

mvanio commented Apr 9, 2020

Same issue but with Spree 4.0.

Bundler could not find compatible versions for gem "spree_auth_devise":

  In snapshot (Gemfile.lock):
    spree_auth_devise (= 4.1.0)

  In Gemfile:
    spree_auth_devise (~> 4.0)

    spree_mail_settings was resolved to 3.3.0, which depends on
      spree_auth_devise (>= 3.1.0, < 4.0)

@leonmuchoki
Copy link

Hi
I also experienced the same issue with Spree 4.1.
I found out the reason is because the spree_mail_settings has been restricted to versions between '3.1' and '4.0'.
You can find this info under the gemspec file at the root: spree_mail_settings.gemspec
Check line 25: spree_version = '>= 3.1.0', '< 4.0'

To test, i forked the spree_mail_settings, pointed the gem version in gemfile to the one i have forked in github. Then i changed the gemspec file to spree_version = '>= 3.1.0', '<= 4.1' and the bundle update worked.
But i now have an issue with the decorator for preferences not being found, so when i open the link to the Mail Settings under admin, it throws an error NoMethodError in Spree::Admin::MailMethods#edit

Why are the decorators not being found ? Any way around it

@leonmuchoki
Copy link

leonmuchoki commented Apr 13, 2020

The case for decorators not being loaded and hence preferences defined under app/model/spree/app_configuration_decorator.rb not being found error....

a small work around as we wait for an updated spree_mail_settings gem, under the fork you created, you can add an initializer folder and add the preferences configuration file there with the preferences specified under models/spree/app_configuration_decorator.rb. This will ensure the added spree_mail_settings preferences are loaded

@Jchan241
Copy link
Author

The case for decorators not being loaded and hence preferences defined under app/model/spree/app_configuration_decorator.rb not being found error....

a small work around as we wait for an updated spree_mail_settings gem, under the fork you created, you can add an initializer folder and add the preferences configuration file there with the preferences specified under models/spree/app_configuration_decorator.rb. This will ensure the added spree_mail_settings preferences are loaded

Thanks, worked like a charm ✌️

javedwaqas added a commit to javedwaqas/spree_mail_settings that referenced this issue Jun 19, 2020
@weefunker
Copy link

weefunker commented Jun 25, 2020

Still getting the same error referenced at the start of this issue. Fixed by using the link above and cloning the gem file into my vendor folder. Edited the line

#spree_mail_settings.gemspec
spree_version = '>= 3.1.0', '<= 4.2'
# gemfile.rb
gem 'spree_mail_settings', :path => 'vendor/spree_mail_settings'

Ran bundle, restarted server and no issues

@kykyi
Copy link

kykyi commented Jul 15, 2020

@leonmuchoki and @weefunker do you guys have recommendations on how to successfully push this to heroku? The views load in development, but no emails received, then when I attempt to push to production I get

remote: -----> Installing dependencies using bundler 2.0.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
remote:        The path `/tmp/build_e65e8575/vendor/spree_mail_settings` does not exist.
remote:        Bundler Output: The path `/tmp/build_e65e8575/vendor/spree_mail_settings` does not exist.

Thanks in advance guys

@weefunker
Copy link

@bashford7 I ended up just using typical rails app mail settings instead. This plugin is completely unnecessary unless you need to allow some nontechie to change the SMTP settings from the dashboard.

#production.rb 
 config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
      :address              => 'smtp.gmail.com',
      :port                 => 587,
      :domain               => 'gmail.com',
      :user_name            => '[email protected]',
      :password             => 'pass',
      :authentication       => 'login',
      :enable_starttls_auto => true
  }

@kykyi
Copy link

kykyi commented Jul 16, 2020

Thanks @weefunker works a treat now! Adapted your answer to work on SendGrid:

config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  host = 'voyage-fromage-60583.herokuapp.com'
  config.action_mailer.default_url_options = { host: host }
  ActionMailer::Base.smtp_settings = {
   :address        => 'smtp.sendgrid.net',
   :port           => '587',
   :authentication => :plain,
   :user_name      => ENV['SENDGRID_USERNAME'],
   :password       => ENV['SENDGRID_PASSWORD'],
   :domain         => 'heroku.com',
   :enable_starttls_auto => true
  }

@staycreativedesign
Copy link

@bashford7 I ended up just using typical rails app mail settings instead. This plugin is completely unnecessary unless you need to allow some nontechie to change the SMTP settings from the dashboard.

#production.rb 
 config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
      :address              => 'smtp.gmail.com',
      :port                 => 587,
      :domain               => 'gmail.com',
      :user_name            => '[email protected]',
      :password             => 'pass',
      :authentication       => 'login',
      :enable_starttls_auto => true
  }

Thanks I was wondering if this was necessary

@ufukayyildiz
Copy link

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

No branches or pull requests

8 participants