Coder Social home page Coder Social logo

spree-social-media-marketing's Introduction

SpreeSocialMediaMarketing

Spree Social Media Marketing helps making regular marketing tasks a breeze.

It helps you with managing your Facebook and Twitter Marketing Accounts. You can post to Facebook and Twitter Accounts, right from the Spree Admin Console. It helps you create few Marketing Events which will trigger automatic posts to active Social Media Acconts.

  • A product selling fast will trigger a low stock marketing event which will post a low stock message on social accounts.
  • When you are receiving bumper orders, you can market that.
  • A new payment method addition will trigger a post about its availability.
  • A new product is available, gets posted automatically on your social accounts
  • A new promotion can be immediately announced on social accounts
  • You want to boast of 1000 users onboard, can be posted automatically on social accounts

You are more of a DIY type, use the manual posting for each social account :)

Pre-requisites

  • You should have account on Facebook Developers
    • Create an App
    • Create a Facebook Page in your account where you want to post updates
  • You should have account on Twitter Account
    • Create an App

Installation

  1. Add this extension to your Gemfile with this line:
gem 'spree_social_media_marketing', github: 'vinsol-spree-contrib/spree-social-media-marketing', branch: 'master'

For Spree version > 3-1, use 'master' branch For Spree version 3-1, use '3-1-stable' branch

The branch option is important: it must match the version of Spree you're using. For example, use 3-1-stable if you're using Spree 3-1-stable or any 3.1.x version.

  1. Install the gem using Bundler:
bundle install
  • Add gem 'koala' with desired version in SpreeCommerce Store Rails App Gemfile to avoid undefined constant error :(
  1. Copy & run migrations
bundle exec rails g spree_social_media_marketing:install
  1. Set Social Accounts API key credentials in Rails secrets (config/secrets.yml)
  • Facebook

    # config/secrets.yml
    development:
      facebook_app_secret: 1234567
      facebook_app_key: abscdg
    
    test:
      facebook_app_secret: 1234567
      facebook_app_key: abscdg
  • Twitter

    # config/secrets.yml
    development:
      twitter_consumer_key: 1234567
      twitter_consumer_secret: abscdg
    
    test:
      twitter_consumer_key: 1234567
      twitter_consumer_secret: abscdg
  • NOTE : Use the key names same as above :)

  1. Restart your server

If your server was running, restart it so that it can find the assets properly.

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_social_media_marketing/factories'

Contributing

If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.

Copyright (c) 2016 [name of extension creator], released under the New BSD License

spree-social-media-marketing's People

Contributors

gauravmahajan31 avatar himanshumishra31 avatar jitendra avatar nishant-cyro avatar pikender avatar shubham-vinsol avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree-social-media-marketing's Issues

[Exception - Facebook] Bad URI when Page ID with Space Entered

Error Trace

URI::InvalidURIError (bad URI(is not URI?): https://graph.facebook.com/Spree Marketing):
  /home/pikender/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in `split'
  /home/pikender/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in `parse'
  /home/pikender/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/uri/common.rb:227:in `parse'
  /home/pikender/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/uri/common.rb:714:in `URI'
  /home/pikender/spree/marketing/marketing/spree-social-media-marketing/app/models/spree/facebook_page.rb:49:in `get_and_assign_page_access_token'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:432:in `block in make_lambda'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:164:in `block in halting'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:504:in `block in call'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:504:in `each'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:504:in `call'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
  activesupport (4.2.7.1) lib/active_support/callbacks.rb:778:in `_run_validation_callbacks'
  activemodel (4.2.7.1) lib/active_model/validations/callbacks.rb:113:in `run_validations!'
  activemodel (4.2.7.1) lib/active_model/validations.rb:338:in `valid?'
  activerecord (4.2.7.1) lib/active_record/validations.rb:58:in `valid?'
  activerecord (4.2.7.1) lib/active_record/validations.rb:83:in `perform_validations'
  activerecord (4.2.7.1) lib/active_record/validations.rb:37:in `save'
  activerecord (4.2.7.1) lib/active_record/attribute_methods/dirty.rb:21:in `save'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:286:in `block (2 levels) in save'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
  activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
  activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
  activerecord (4.2.7.1) lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:220:in `transaction'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:286:in `block in save'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
  activerecord (4.2.7.1) lib/active_record/transactions.rb:285:in `save'
  /home/pikender/spree/marketing/marketing/spree-social-media-marketing/app/controllers/spree/admin/facebook_pages_controller.rb:10:in `create'

Fresh setup raises error when populating spree seed and sample data

Steps to replicate

  • Create a new spree store Rails App
  • Add the extension in spree store and set-up as needed
  • Run bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:seed and it raises below error
pikender@Pikenders-MacBook-Pro:~/spree/store$ bundle exec rake db:seed
loading ruby /Users/pikender/.rvm/gems/ruby-2.3.1@spree/bundler/gems/spree_auth_devise-1ac9dcc33049/db/default/users.rb
Create the admin user (press enter for defaults).
Email [[email protected]]: [email protected]
Password [spree123]: 
rake aborted!
NoMethodError: undefined method `threshold' for nil:NilClass
/Users/pikender/.rvm/gems/ruby-2.3.1@spree/bundler/gems/spree-social-media-marketing-26f44b4b1a92/app/models/spree/user_decorator.rb:21:in `check_if_any_milestone_reached'
  • Comment the extension and try again to add admin user, it works

  • Run bundle exec rake spree_sample:load and it raises below error

pikender@Pikenders-MacBook-Pro:~/spree/marketing/sales_tax/spree-next-demo$ bundle exec rake spree_sample:load
Loaded Payment Methods samples
Loaded Shipping Categories samples
Loaded Shipping Methods samples
Loaded Tax Categories samples
Loaded Tax Rates samples
rake aborted!
NoMethodError: undefined method `active?' for nil:NilClass
Did you mean?  acts_like?
/Users/pikender/.rvm/gems/ruby-2.3.1@spree/bundler/gems/spree-social-media-marketing-26f44b4b1a92/app/models/spree/product_decorator.rb:26:in `create_marketing_job'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.