leadersend 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/leadersend/mailer.rb +2 -1
- data/lib/leadersend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7f6389955380ae269c5776a138f7b0112bcbe18
|
4
|
+
data.tar.gz: e7cdce3333fb0151e510afef9b2cb652a0e4877a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83672e4de816b4a1b4e159b23baeb1a8cd4f4840156d570db6671ed4cb4c47f5aca6a54b05a24f9f409f0eb57ed32f5bc3520a866297335cdfce4225ec9419a
|
7
|
+
data.tar.gz: e71aea2e75a3081ea02a13fce4802bac4b070dde5af4304fe439c888d8189b2ab53e568d7855659f3cba6453210d04ff0bc86089137b15dc78e20a5768f52f8f
|
data/README.md
CHANGED
@@ -47,10 +47,15 @@ ActionMailer::Base.smtp_settings = {
|
|
47
47
|
```
|
48
48
|
|
49
49
|
### Send Email
|
50
|
-
Instantiate a `Leadersend::Mail` object with given parameters
|
50
|
+
####Instantiate a `Leadersend::Mail` object with given parameters
|
51
|
+
##### Version with template_path and locals
|
51
52
|
```ruby
|
52
53
|
mailer = Leadersend::Mail.new to: self.email, from: from, fromname: fromname, subject: subject, template_path: template_path, locals: locals, title: title
|
53
54
|
```
|
55
|
+
##### Version with template (raw html)
|
56
|
+
```ruby
|
57
|
+
mailer = Leadersend::Mail.new to: self.email, from: from, fromname: fromname, subject: subject, template: template, title: title
|
58
|
+
```
|
54
59
|
Parameter examples and explanations:
|
55
60
|
```ruby
|
56
61
|
to: "example@email.com"
|
@@ -62,7 +67,7 @@ title: "It is friday!"
|
|
62
67
|
locals: {variable: value, another_variable: different_value} # These will be made available in the template
|
63
68
|
```
|
64
69
|
|
65
|
-
Call the
|
70
|
+
Call the `#send` method on the instantiated object to send an email. This method returns a hash with response
|
66
71
|
```ruby
|
67
72
|
sent_mail_hash = mailer.send
|
68
73
|
```
|
data/lib/leadersend/mailer.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Leadersend
|
2
2
|
class Mail
|
3
|
-
def initialize to: nil, from: nil, fromname: nil, subject: "System", template_path: nil, locals: {}, title: "System"
|
3
|
+
def initialize to: nil, from: nil, fromname: nil, subject: "System", template_path: nil, locals: {}, title: "System", template: ""
|
4
4
|
@api_email_url = Leadersend.config.api_url
|
5
5
|
@api_user = Leadersend.config.username
|
6
6
|
@api_key = Leadersend.config.api_key
|
@@ -12,6 +12,7 @@ module Leadersend
|
|
12
12
|
@from = from
|
13
13
|
@fromname = fromname
|
14
14
|
@template_path = template_path
|
15
|
+
@template = template
|
15
16
|
|
16
17
|
if @template_path
|
17
18
|
@template = ApplicationController.new.render_to_string(:partial => @template_path, :locals => @locals )
|
data/lib/leadersend/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leadersend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Epigene
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-02-
|
13
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|