smailer 0.2.10 → 0.2.11

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.
data/README.md CHANGED
@@ -20,9 +20,19 @@ Then run `bundle install`. For Rails 2.x projects which do not use Bundler, add
20
20
 
21
21
  To create the tables needed by Smailer to operate, run the `smailer:migration` generator after installing the Gem. For Rails 3, you can do this:
22
22
 
23
- rails g smailer:migration
23
+ rails g smailer:migration && bundle exec rake db:migrate
24
24
 
25
- For Rails 2.x projects, use `script/generate smailer_migration`.
25
+ For Rails 2.x projects, use `script/generate smailer_migration && rake db:migrate` to generate and run the migration.
26
+
27
+ ### Initializing the plugin's settings
28
+
29
+ Since the plugin has been designed to be managed via an admin UI, its settings are stored in a simple key-value table, interfaced by the `Smailer::Models::Property` model. Here is some sample data you can use to initialize your settings with:
30
+
31
+ Smailer::Models::Property.create! :name => 'queue.max_retries', :value => '0', :notes => '0 = unlimited.'
32
+ Smailer::Models::Property.create! :name => 'queue.max_lifetime', :value => '172800', :notes => 'In seconds; 0 = unlimited.'
33
+ Smailer::Models::Property.create! :name => 'queue.batch_size', :value => '100', :notes => 'Emails to send per run.'
34
+
35
+ These properties and values are also the defaults.
26
36
 
27
37
  ## Usage and documentation
28
38
 
@@ -8,9 +8,9 @@ module Smailer
8
8
  delivery_method Rails.configuration.action_mailer.delivery_method
9
9
  end
10
10
 
11
- batch_size = Smailer::Models::Property.get('queue.batch_size').to_i
12
- max_retries = Smailer::Models::Property.get('queue.max_retries').to_i
13
- max_lifetime = Smailer::Models::Property.get('queue.max_lifetime').to_i
11
+ batch_size = (Smailer::Models::Property.get('queue.batch_size') || 100).to_i
12
+ max_retries = (Smailer::Models::Property.get('queue.max_retries') || 0).to_i
13
+ max_lifetime = (Smailer::Models::Property.get('queue.max_lifetime') || 172800).to_i
14
14
 
15
15
  results = []
16
16
  Smailer::Models::QueuedMail.order(:retries.asc, :id.asc).limit(batch_size).each do |queue_item|
@@ -1,3 +1,3 @@
1
1
  module Smailer
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smailer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 10
10
- version: 0.2.10
9
+ - 11
10
+ version: 0.2.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dimitar Dimitrov