Skip to content

spree-abs/spree_mailchimp_ecommerce

 
 

Repository files navigation

SpreeMailchimpEcommerce

Build Status Maintainability Test Coverage

Installation

  1. Add this line to your application's Gemfile:
gem 'spree_mailchimp_ecommerce', github: 'spark-solutions/spree_mailchimp_ecommerce', branch: 'master'
  1. Install the gem using Bundler:
bundle install
  1. Install extension
$ bundle exec rails g spree_mailchimp_ecommerce:install
  1. Restart your server

  2. Setup you mailchimp credentials on http://yoursite.test/admin/mailchimp_settings and than click 'Setup your store' button

User first and last name

By default, Spree doesn't provide firstname and lastname methods for the User model. However, MailChimp requires this fields. SpreeMailchimpEcommerce define these methods in presenter as

  def firstname
    user.try(:firstname) || user&.bill_address&.firstname || "unknown firstname"
  end

  def lastname
    user.try(:lastname) || user&.bill_address&.lastname || "unknown lastname"
  end

Feel free to define firstname and lastname in your User model decorator.

Also, based on a Spree and Rails version, you can have different method to retrieve image url. By default it defined as

  def mailchimp_image_url
    images.first&.attachment&.url
  end

You can redifine it in your Product model decorator

License

The gem is available as open source under the terms of the MIT License.

About

Mailchimp ecommerce api extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 96.3%
  • HTML 3.7%