smailer 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smailer/models/mail_campaign.rb +9 -1
- data/lib/smailer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 882d4145d4e47583284e40abbea61a4904131776
|
4
|
+
data.tar.gz: b411a56313daeaaf2fcf7d6dd48727ab692747ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91baf3610b97979df6157b8420ef4e60288d2d786b878d0f2677342dda4f8deb54864be4186b0ca14eef5287233c9435536d04e01af3598a2751b0fdac7b4734
|
7
|
+
data.tar.gz: 5527e195641bfdde27c9e5843905fa35d0760f55fe6ae3b7a56c2968b4f7af8c37dcced95a8083e2bb0722f2ea341ac6aad23806e896ea6dbb75c067433c7683
|
@@ -10,12 +10,16 @@ module Smailer
|
|
10
10
|
belongs_to :mailing_list
|
11
11
|
has_many :queued_mails, :dependent => :destroy
|
12
12
|
has_many :finished_mails, :dependent => :destroy
|
13
|
+
has_many :attachments,
|
14
|
+
:class_name => '::Smailer::Models::MailCampaignAttachment'
|
13
15
|
|
14
16
|
validates_presence_of :mailing_list_id, :from
|
15
17
|
validates_numericality_of :mailing_list_id, :unsubscribe_methods, :only_integer => true, :allow_nil => true
|
16
18
|
validates_length_of :from, :subject, :maximum => 255, :allow_nil => true
|
17
19
|
|
18
|
-
|
20
|
+
unless Smailer::Compatibility.rails_4?
|
21
|
+
attr_accessible :mailing_list_id, :from, :subject, :body_html, :body_text
|
22
|
+
end
|
19
23
|
|
20
24
|
def add_unsubscribe_method(method_specification)
|
21
25
|
unsubscribe_methods_list_from(method_specification).each do |method|
|
@@ -50,6 +54,10 @@ module Smailer
|
|
50
54
|
opened_mails_count.to_f / sent_mails_count
|
51
55
|
end
|
52
56
|
|
57
|
+
def add_attachment(filename, path)
|
58
|
+
self.attachments.create!(:filename => filename, :path => path)
|
59
|
+
end
|
60
|
+
|
53
61
|
def self.unsubscribe_methods
|
54
62
|
methods = {}
|
55
63
|
UnsubscribeMethods.constants.map do |method_name|
|
data/lib/smailer/version.rb
CHANGED