shoppe-notification 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 052f88adf469caa57da7561e6d7372b8249d784b
4
+ data.tar.gz: 9515a8c4786ae0374184af0040ee086fae66f90a
5
+ SHA512:
6
+ metadata.gz: 5af67152bbb4fd81660d2c7cd4bcf608672bde5ed26f9f6b84dce5211114f3a0a5ce0a80905aee743f6dca7c9f3272df64178c11bef6fb15210d4ead9c94dd63
7
+ data.tar.gz: 20a01263787bf72ef5c14fac9b92f62654fda65a81a6bbf2bc7896834e3701e2b774887df95cd5ca5281da5fec7e303829077ff572224bb9640c71a017bc430d
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in shoppe-notification.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Shoppe::Notification
2
+
3
+ A Shoppe Module which emails staff when new orders are received.
4
+
5
+ It links to the `confirmation` callback and sends an email using a normal
6
+ Rails Mailer to all Users (not orders) saying that a new order has been
7
+ received. It is sent from the set `outbound_email_address`.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile and `bundle install`
12
+
13
+ ```ruby
14
+ gem "shoppe-notification"
15
+ ```
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,11 @@
1
+ module Shoppe
2
+ class NotificationMailer < ActionMailer::Base
3
+
4
+ def order_received(order)
5
+ @order = order
6
+ staff = Shoppe::User.all.map(&:email_address)
7
+ mail from: Shoppe.settings.outbound_email_address, to: staff, subject: "New Order Received"
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ Hello Team!
2
+
3
+ Re: Order #<%= @order.number %>
4
+
5
+ We're pleased to let you know that we have just received a new order! You might want to accept and ship it.
6
+
7
+ Many thanks,
8
+
9
+ <%= Shoppe.settings.store_name %>
10
+ <%= Shoppe.settings.email_address %>
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "shoppe/notification"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,14 @@
1
+ require "shoppe/notification/version"
2
+ require "shoppe/notification/engine"
3
+
4
+ module Shoppe
5
+ module Notification
6
+
7
+ def self.setup
8
+ Shoppe::Order.before_confirmation do
9
+ Shoppe::NotificationMailer.order_received(self).deliver_now
10
+ end
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Shoppe
2
+ module Notification
3
+ class Engine < Rails::Engine
4
+
5
+ initializer "shoppe.notification.initializer" do
6
+ Shoppe::Notification.setup
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Shoppe
2
+ module Notification
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'shoppe/notification/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "shoppe-notification"
8
+ spec.version = Shoppe::Notification::VERSION
9
+ spec.authors = ["Dean Perry"]
10
+ spec.email = ["dean@voupe.com"]
11
+
12
+ spec.summary = "A Shoppe module which emails staff on new orders"
13
+ spec.description = "A Shoppe module which emails staff on new orders"
14
+ spec.homepage = "http://tryshoppe.com"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "shoppe"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.8"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shoppe-notification
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dean Perry
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-03-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: shoppe
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: A Shoppe module which emails staff on new orders
56
+ email:
57
+ - dean@voupe.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - README.md
66
+ - Rakefile
67
+ - app/mailers/shoppe/notification_mailer.rb
68
+ - app/views/shoppe/notification_mailer/order_received.text.erb
69
+ - bin/console
70
+ - bin/setup
71
+ - lib/shoppe/notification.rb
72
+ - lib/shoppe/notification/engine.rb
73
+ - lib/shoppe/notification/version.rb
74
+ - shoppe-notification.gemspec
75
+ homepage: http://tryshoppe.com
76
+ licenses: []
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: A Shoppe module which emails staff on new orders
98
+ test_files: []
99
+ has_rdoc: