no_notifier_needed 2.3.6 → 2.3.7
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.7
|
data/initializers/notifier.rb
CHANGED
@@ -15,6 +15,9 @@ class Notifier < ActionMailer::Base
|
|
15
15
|
@template = EmailTemplate.find_by_name(email_name)
|
16
16
|
raise "Email Template name not found" if @template.nil?
|
17
17
|
|
18
|
+
|
19
|
+
#configure this to only run as one block depending on what the template responds to
|
20
|
+
|
18
21
|
if @template.respond_to?(:send_via_mandrill) && @template.send_via_mandrill?
|
19
22
|
Notifier.smtp_settings = {
|
20
23
|
:address => "smtp.mandrillapp.com",
|
@@ -24,12 +27,12 @@ class Notifier < ActionMailer::Base
|
|
24
27
|
:password => NoNotifierNeeded.mandrill_password,
|
25
28
|
:authentication => 'login' # Mandrill supports 'plain' or 'login'
|
26
29
|
}
|
27
|
-
|
30
|
+
elsif @template.respond_to?(:send_via_gmail) && @template.send_via_gmail?
|
28
31
|
pwd = NoNotifierNeeded.gmail_password.first
|
29
32
|
Notifier.smtp_settings = {
|
30
33
|
:address => 'smtp.gmail.com',
|
31
34
|
:port => 587,
|
32
|
-
:domain => NoNotifierNeeded.
|
35
|
+
:domain => NoNotifierNeeded.gmail_domain,
|
33
36
|
:user_name => NoNotifierNeeded.gmail_user_name,
|
34
37
|
:password => pwd,
|
35
38
|
:authentication => 'login',
|
@@ -2,7 +2,8 @@ class EmailTemplate < ActiveRecord::Base
|
|
2
2
|
before_save :clean_inputs
|
3
3
|
|
4
4
|
attr_accessible :body, :subject, :name, :template_type, :sent_to, :when_sent,
|
5
|
-
:email_template_comments_attributes, :from_name, :from_email, :reply_to, :send_via_mandrill
|
5
|
+
:email_template_comments_attributes, :from_name, :from_email, :reply_to, :send_via_mandrill,
|
6
|
+
:send_via_gmail
|
6
7
|
|
7
8
|
def clean_inputs
|
8
9
|
body.strip!
|
@@ -9,6 +9,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
|
|
9
9
|
t.string :body
|
10
10
|
t.string :template_type
|
11
11
|
t.boolean :send_via_mandrill, :default => false, :null => false
|
12
|
+
t.boolean :send_via_gmail, :default => false, :null => false
|
12
13
|
t.integer :email_template_type_id
|
13
14
|
end
|
14
15
|
|
@@ -2,21 +2,30 @@ module NoNotifierNeeded
|
|
2
2
|
module Config
|
3
3
|
|
4
4
|
VALID_OPTIONS_KEYS = [
|
5
|
+
#Defaults
|
5
6
|
:from_email,
|
6
7
|
:from_name,
|
7
8
|
:bcc,
|
8
9
|
:reply_to,
|
10
|
+
|
11
|
+
#Url Options
|
9
12
|
:host,
|
10
13
|
:controller,
|
11
14
|
:action,
|
15
|
+
|
16
|
+
#mandrill options
|
12
17
|
:mandrill_user_name,
|
13
18
|
:mandrill_password,
|
14
19
|
:mandrill_port,
|
20
|
+
|
21
|
+
#current User options
|
15
22
|
:current_user_model,
|
16
23
|
:current_user_id_method,
|
24
|
+
|
25
|
+
#Gmail options
|
17
26
|
:gmail_user_name,
|
18
27
|
:gmail_password,
|
19
|
-
:
|
28
|
+
:gmail_domain
|
20
29
|
].freeze
|
21
30
|
|
22
31
|
# @private
|
data/no_notifier_needed.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "no_notifier_needed"
|
8
|
-
s.version = "2.3.
|
8
|
+
s.version = "2.3.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Robert R. Meyer"]
|
12
|
-
s.date = "2013-05-
|
12
|
+
s.date = "2013-05-05"
|
13
13
|
s.description = "A work in progress: Replace ActionMailer::Base class redundency. Temlating using haml or erb."
|
14
14
|
s.email = "Blue.Dog.Archolite@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no_notifier_needed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|