maktoub 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9392ef94eb6ba44154c9ab47cd45a38ad2708d6d
4
- data.tar.gz: 9a233656e7ff759cea64fb7d6c97860e3c33bb92
3
+ metadata.gz: 7701c2c470bac6ecc1aef1ed21be948f1b6fd3aa
4
+ data.tar.gz: 98c10d551dd0e0ce3e1205646df72134d4a2338a
5
5
  SHA512:
6
- metadata.gz: f03f0ecc323683ef970883791afa3a95c85315c0d64d8674e926be75c1daf8e85c02cfe769336a98b35b8d829e6ce091f0414dff70b667848809bf100b65e717
7
- data.tar.gz: 568845bb9c8acda1de2343583965ca9d115c01905058d7ac94925680dbaca30dc092dc6ad9dad16c8a788879d88d2496676cb5ad47f4a925f0d11c99a1ab2839
6
+ metadata.gz: 9b2b382839020311e092633494e0358249bcb1e678978d9320a169a86913df279de7ee3c12b280a146fb21ad1d5fe05038246b47d883c48e3b13d8275df4b393
7
+ data.tar.gz: 9d15a5881e0effe0f8e1e7552bbed9ff030e2ada99659651f8d71ca55bc1fd3974a6474574f17d3259de651c6dd540fc86da3172f49c671e8ff6e1414f90f2b8
@@ -12,6 +12,10 @@ Maktoub is a Ruby on Rails engine for email newsletters.
12
12
 
13
13
  Then 'bundle install'
14
14
 
15
+ == Compatibility
16
+
17
+ Compatible with Rails 4+. For Rails 3.1+ use version 0.3.1
18
+
15
19
  == Usage
16
20
 
17
21
  === Configuration
@@ -12,20 +12,14 @@ module Maktoub
12
12
  @subject = newsletter_name.humanize.titleize
13
13
  @email = params[:email]
14
14
  @newsletter_name = newsletter_name
15
- mail_fields = {
16
-
17
- }
18
-
19
- premailer = Premailer.new(render("maktoub/newsletters/#{newsletter_name}").to_s,
20
- with_html_string: true,
21
- link_query_string: "utm_source=newsletter&utm_medium=email&utm_campaign=#{CGI::escape(@subject)}"
22
- )
23
15
 
24
16
  mail(
25
17
  subject: @subject,
26
18
  to: params[:email],
27
- body: premailer.to_inline_css,
28
- content_type: "text/html"
19
+ with_html_string: true,
20
+ link_query_string: "utm_source=newsletter&utm_medium=email&utm_campaign=#{CGI::escape(@subject)}",
21
+ template_path: 'maktoub/newsletters',
22
+ template_name: newsletter_name
29
23
  )
30
24
  end
31
25
  end
@@ -0,0 +1,10 @@
1
+ <h1>Readme</h1>
2
+ <p>Place your newsletter partials in your views/maktoub/newsletters folder. The partial name is converted into the newsletter subject. </p>
3
+
4
+ <p>Multipart emails:</p>
5
+ <ul>
6
+ <li>To send html only emails, only include an html template</li>
7
+ <li>To send text only emails, only include a text template</li>
8
+ <li>To send multipart emails, include both template types</li>
9
+ </ul>
10
+
@@ -0,0 +1,8 @@
1
+ README
2
+
3
+ Place your newsletter partials in your views/maktoub/newsletters folder. The partial name is converted into the newsletter subject.
4
+
5
+ To send html only emails, only include an html template
6
+ To send text only emails, only include a text template
7
+ To send multipart emails, include both template types
8
+
@@ -32,7 +32,7 @@ module Maktoub
32
32
  end
33
33
 
34
34
  def unsubscribe(email)
35
- if subscribers.class == ActiveRecord::Relation
35
+ if subscribers.class.respond_to?(:to_sql) #check if ActiveRecord relation
36
36
  subscribers.where(email_field => email).first.send(unsubscribe_method)
37
37
  else
38
38
  subscribers.select do |s|
@@ -1,4 +1,4 @@
1
1
  module Maktoub
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maktoub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaid Zawaideh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-24 00:00:00.000000000 Z
12
+ date: 2015-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.1.1
20
+ version: 4.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 3.1.1
27
+ version: 4.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: premailer-rails
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +103,8 @@ files:
103
103
  - app/views/layouts/maktoub/_styles.erb
104
104
  - app/views/layouts/maktoub/application.html.erb
105
105
  - app/views/layouts/maktoub/newsletter_mailer.erb
106
- - app/views/maktoub/newsletters/readme.erb
106
+ - app/views/maktoub/newsletters/readme.html.erb
107
+ - app/views/maktoub/newsletters/readme.text.erb
107
108
  - app/views/maktoub/subscribers/edit.html.erb
108
109
  - app/views/maktoub/subscribers/update.html.erb
109
110
  - config/routes.rb
@@ -1,3 +0,0 @@
1
- <h1>Readme</h1>
2
- <p>Place your newsletter partials in your views/maktoub/newsletters folder. The partial name is converted into the newsletter subject.</p>
3
-