spree_mail 0.40.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/README.md +19 -0
  2. data/Rakefile +94 -0
  3. data/app/controllers/admin/emails_controller.rb +61 -0
  4. data/app/controllers/admin/subscribers_controller.rb +78 -0
  5. data/app/controllers/emails_controller.rb +19 -0
  6. data/app/controllers/subscribers_controller.rb +42 -0
  7. data/app/mailers/email_mailer.rb +24 -0
  8. data/app/model/email.rb +77 -0
  9. data/app/model/subscriber.rb +39 -0
  10. data/app/views/admin/emails/_form.html.erb +78 -0
  11. data/app/views/admin/emails/edit.html.erb +15 -0
  12. data/app/views/admin/emails/index.html.erb +64 -0
  13. data/app/views/admin/emails/new.html.erb +15 -0
  14. data/app/views/admin/emails/show.html.erb +20 -0
  15. data/app/views/admin/hooks/_subscribers_tab.html.erb +1 -0
  16. data/app/views/admin/shared/_spree_mail_sub_nav.html.erb +8 -0
  17. data/app/views/admin/subscribers/_form.html.erb +19 -0
  18. data/app/views/admin/subscribers/_options.html.erb +5 -0
  19. data/app/views/admin/subscribers/edit.html.erb +15 -0
  20. data/app/views/admin/subscribers/index.html.erb +76 -0
  21. data/app/views/admin/subscribers/new.html.erb +15 -0
  22. data/app/views/admin/subscribers/show.html.erb +19 -0
  23. data/app/views/hooks/_footer_left.html.erb +1 -0
  24. data/app/views/hooks/_subscriber_sign_up_form.html.erb +4 -0
  25. data/app/views/hooks/_subscriber_static_content.html.erb +3 -0
  26. data/app/views/layouts/email.html.erb +81 -0
  27. data/app/views/subscribers/_fields.html.erb +11 -0
  28. data/app/views/subscribers/new.html.erb +17 -0
  29. data/app/views/subscribers/show.html.erb +16 -0
  30. data/config/locales/en.yml +33 -0
  31. data/config/routes.rb +20 -0
  32. data/db/migrate/install_spree_mail.rb +25 -0
  33. data/lib/spree_mail.rb +24 -0
  34. data/lib/spree_mail/custom_hooks.rb +20 -0
  35. data/lib/spree_mail/version.rb +3 -0
  36. data/lib/tasks/install.rake +36 -0
  37. data/public/images/mailer/airmail.gif +0 -0
  38. data/public/images/mailer/background.jpg +0 -0
  39. data/public/images/mailer/postmark.png +0 -0
  40. data/public/stylesheets/admin/spree_mail.css +38 -0
  41. metadata +149 -0
@@ -0,0 +1,11 @@
1
+ <p>
2
+ <%= form.label :name %><br/>
3
+ <%= form.text_field :name, :class => 'title required' %>
4
+ </p>
5
+ <p>
6
+ <%= form.label :email %><br/>
7
+ <%= form.text_field :email, :class => 'title required' %>
8
+ </p>
9
+ <p class="action">
10
+ <%= form.submit t("sign_up") %>
11
+ </p>
@@ -0,0 +1,17 @@
1
+ <div class="left">
2
+
3
+ <%= hook :subscriber_static_content do %>
4
+ <%= render 'hooks/subscriber_static_content' %>
5
+ <% end %>
6
+
7
+ </div>
8
+
9
+ <div class="right">
10
+
11
+ <%= hook :subscriber_sign_up_form do %>
12
+ <%= render 'hooks/subscriber_sign_up_form' %>
13
+ <% end %>
14
+
15
+ </div>
16
+
17
+ <div class="clear">&nbsp;</div>
@@ -0,0 +1,16 @@
1
+ <h1>Unsubscribe from our Mailing List</h1>
2
+
3
+ <p>Please enter your email address below:</p>
4
+
5
+ <% token = Digest::SHA1.hexdigest(Time.now.to_s) %>
6
+ <%= form_for @subscriber, :url => unsubscribe_subscriber_path(@subscriber.token) do |form| %>
7
+ <p>
8
+ <%= form.label :email %>
9
+ <%= form.text_field :email, :value => "" %>
10
+ <%= form.hidden_field :token, :value => token %>
11
+ </p>
12
+ <p>
13
+ <%= form.submit "Unsubscribe" %> or
14
+ <%= link_to "Cancel", root_path %>
15
+ </p>
16
+ <% end %>
@@ -0,0 +1,33 @@
1
+ en:
2
+ spree_mail: Spree Mail
3
+ newsletter_sign_up: Sign up for our Newsletter
4
+
5
+ subscribers: Subscribers
6
+ listing_subscribers: Listing Subscribers
7
+ show_subscriber: Show Subscriber
8
+ new_subscriber: New Subscriber
9
+ editing_subscriber: Editing Subscriber
10
+ view_unsubscribed: View Unsubscribed
11
+ view_all_subscribers: View All Subscribers
12
+
13
+ resubscribe_success: "Successfully Resubscribed"
14
+ resubscribe_failed: "Resubscribe Failed"
15
+ unsubscribe_success: "Successfully Unsubscribed"
16
+ unsubscribe_failed: "Unsubscribed failed"
17
+
18
+ listing_emails: Listing Emails
19
+ show_email: Show Email
20
+ new_email: New Email
21
+ editing_email: Editing Email
22
+
23
+ emails: Emails
24
+
25
+ to: To
26
+ send: Send
27
+ subject: Subject
28
+ message_body: Message Body
29
+
30
+ delivery_success: Your email was successfully sent!
31
+ delivery_failed: Sorry, your email could not be sent.
32
+
33
+
@@ -0,0 +1,20 @@
1
+ Rails.application.routes.draw do
2
+
3
+ get "/email/:token/:id", :to => "emails#show", :as => :read_email
4
+
5
+ resources :subscribers, :except => [:edit,:update] do
6
+ put :unsubscribe, :on => :member
7
+ end
8
+
9
+ namespace(:admin) do
10
+ resources :subscribers do
11
+ get :unsubscribed, :on => :collection
12
+ get :resubscribe, :on => :member
13
+ get :unsubscribe, :on => :member
14
+ end
15
+ resources :emails do
16
+ get :deliver, :on => :member, :path => 'send'
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,25 @@
1
+ class InstallSpreeMail < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ create_table :subscribers do |t|
5
+ t.string :token
6
+ t.string :name
7
+ t.string :email
8
+ t.datetime :unsubscribed_at
9
+ t.timestamps
10
+ end
11
+ create_table :emails do |t|
12
+ t.string :token
13
+ t.text :to
14
+ t.string :subject
15
+ t.text :body
16
+ t.timestamps
17
+ end
18
+ end
19
+
20
+ def self.down
21
+ drop_table :subscribers
22
+ drop_table :emails
23
+ end
24
+
25
+ end
@@ -0,0 +1,24 @@
1
+ require 'mustache'
2
+ require 'spree_mail/version'
3
+ require 'spree_mail/custom_hooks'
4
+
5
+ module SpreeMail
6
+
7
+ class Engine < Rails::Engine
8
+
9
+ config.autoload_paths += %W(#{config.root}/lib)
10
+
11
+ initializer "static assets" do |app|
12
+ app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{config.root}/public"
13
+ end
14
+
15
+ #def self.activate
16
+ # #Dir["../app/**/*.rb"].each do |c|
17
+ # # puts c
18
+ # # #Rails.env.production? ? require(c) : load(c)
19
+ # #end
20
+ #end
21
+
22
+ #config.to_prepare &method(:activate).to_proc
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module SpreeMail
2
+ class CustomHooks < Spree::ThemeSupport::HookListener
3
+ # custom hooks go here
4
+
5
+ #replace :admin_product_form_right, 'admin/hooks/product_form_right'
6
+ #
7
+ #replace :cart_item_price, 'hooks/cart_item_price'
8
+ #replace :cart_item_total, 'hooks/cart_item_total'
9
+ #
10
+ #insert_before :inside_cart_form, 'hooks/wholesale_customer_id'
11
+ #
12
+ #insert_after :admin_orders_index_headers, 'admin/hooks/admin_orders_index_headers'
13
+ #insert_after :admin_orders_index_rows, 'admin/hooks/admin_orders_index_rows'
14
+ #insert_after :admin_orders_index_search, 'admin/hooks/admin_orders_index_search'
15
+
16
+ insert_after :footer_left, 'hooks/footer_left'
17
+ insert_after :admin_tabs, 'admin/hooks/subscribers_tab'
18
+
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module SpreeMail
2
+ VERSION = "0.40.0.1"
3
+ end
@@ -0,0 +1,36 @@
1
+ namespace :spree_mail do
2
+
3
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
4
+ task :install do
5
+ Rake::Task['spree_mail:install:migrations'].invoke
6
+ end
7
+
8
+ namespace :install do
9
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
10
+ task :migrations do
11
+
12
+ source = File.expand_path('../../../db/migrate', __FILE__)
13
+ destination = File.join(Rails.root, 'db', 'migrate')
14
+
15
+ FileUtils.mkdir_p(destination)
16
+
17
+ migrations = Dir.entries(destination).select{|file| file.match('.rb') }
18
+
19
+ files = Dir.entries(source).select{|file| file.match('.rb') }
20
+ files.each_with_index do |file,index|
21
+ time = Time.now + (index * 7)
22
+ number = [time.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % index].max
23
+ new_file = [number,file].join('_')
24
+ src = File.join(source, file)
25
+ dst = File.join(destination, new_file)
26
+ if 0 < migrations.select{|migration| migration.match(file) != nil }.length
27
+ puts "#{file} exists!"
28
+ else
29
+ FileUtils.cp(src, dst)
30
+ puts "#{new_file} copied!"
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,38 @@
1
+ ul.select {
2
+ list-style-type: none;
3
+ margin: 0;
4
+ padding: 7px;
5
+ height: 309px;
6
+ background-color: #fff;
7
+ border: 1px solid #bbb;
8
+ overflow: auto;
9
+ }
10
+ li.checkbox {
11
+ clear: both;
12
+ display: block;
13
+ margin-bottom: 2px;
14
+ padding: 3px;
15
+ border: 1px solid #e0e0e0;
16
+ background-color: #eee;
17
+ }
18
+ li.checkbox:hover {
19
+ background-color: #0095DA;
20
+ border: 1px solid #34599b;
21
+ color: #fff;
22
+ cursor: pointer;
23
+ }
24
+ label.checkbox {
25
+ clear: none;
26
+ margin: 0 0 0 5px;
27
+ padding: 0;
28
+ }
29
+ input.checkbox {
30
+ float: left;
31
+ display: block;
32
+ }
33
+ textarea.contacts {
34
+ margin: 0;
35
+ padding: 5px;
36
+ width: 280px;
37
+ height: 300px;
38
+ }
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_mail
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 40
8
+ - 0
9
+ - 1
10
+ version: 0.40.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Spencer Steffen
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-26 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: spree_core
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 0
31
+ - 40
32
+ - 2
33
+ version: 0.40.2
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: spree_auth
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ segments:
45
+ - 0
46
+ - 40
47
+ - 2
48
+ version: 0.40.2
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: mustache
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
61
+ - 12
62
+ - 0
63
+ version: 0.12.0
64
+ type: :runtime
65
+ version_requirements: *id003
66
+ description: Spree Mail extends Spree by adding a mailing list subscriber model, sign up forms and an admin to send messages.
67
+ email:
68
+ - spencer@citrusme.com
69
+ executables: []
70
+
71
+ extensions: []
72
+
73
+ extra_rdoc_files: []
74
+
75
+ files:
76
+ - README.md
77
+ - config/locales/en.yml
78
+ - config/routes.rb
79
+ - lib/spree_mail/custom_hooks.rb
80
+ - lib/spree_mail/version.rb
81
+ - lib/spree_mail.rb
82
+ - lib/tasks/install.rake
83
+ - app/controllers/admin/emails_controller.rb
84
+ - app/controllers/admin/subscribers_controller.rb
85
+ - app/controllers/emails_controller.rb
86
+ - app/controllers/subscribers_controller.rb
87
+ - app/mailers/email_mailer.rb
88
+ - app/model/email.rb
89
+ - app/model/subscriber.rb
90
+ - app/views/admin/emails/_form.html.erb
91
+ - app/views/admin/emails/edit.html.erb
92
+ - app/views/admin/emails/index.html.erb
93
+ - app/views/admin/emails/new.html.erb
94
+ - app/views/admin/emails/show.html.erb
95
+ - app/views/admin/hooks/_subscribers_tab.html.erb
96
+ - app/views/admin/shared/_spree_mail_sub_nav.html.erb
97
+ - app/views/admin/subscribers/_form.html.erb
98
+ - app/views/admin/subscribers/_options.html.erb
99
+ - app/views/admin/subscribers/edit.html.erb
100
+ - app/views/admin/subscribers/index.html.erb
101
+ - app/views/admin/subscribers/new.html.erb
102
+ - app/views/admin/subscribers/show.html.erb
103
+ - app/views/hooks/_footer_left.html.erb
104
+ - app/views/hooks/_subscriber_sign_up_form.html.erb
105
+ - app/views/hooks/_subscriber_static_content.html.erb
106
+ - app/views/layouts/email.html.erb
107
+ - app/views/subscribers/_fields.html.erb
108
+ - app/views/subscribers/new.html.erb
109
+ - app/views/subscribers/show.html.erb
110
+ - db/migrate/install_spree_mail.rb
111
+ - public/images/mailer/airmail.gif
112
+ - public/images/mailer/background.jpg
113
+ - public/images/mailer/postmark.png
114
+ - public/stylesheets/admin/spree_mail.css
115
+ - Rakefile
116
+ has_rdoc: false
117
+ homepage: http://github.com/citrus/spree_mail
118
+ licenses: []
119
+
120
+ post_install_message:
121
+ rdoc_options: []
122
+
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ segments:
131
+ - 0
132
+ version: "0"
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ segments:
139
+ - 0
140
+ version: "0"
141
+ requirements: []
142
+
143
+ rubyforge_project:
144
+ rubygems_version: 1.3.7
145
+ signing_key:
146
+ specification_version: 3
147
+ summary: Spree Mail adds mailing list signup and delivery features.
148
+ test_files: []
149
+