leadersend 1.0.0 → 1.0.2
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 +4 -4
- data/README.md +5 -5
- data/lib/leadersend.rb +0 -5
- data/lib/leadersend/mailer.rb +3 -3
- data/lib/leadersend/version.rb +1 -1
- data/spec/tests/basic_spec.rb +0 -4
- 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: fc4330110cb3c2886948c54ad5c5f4a39c33d0a2
|
4
|
+
data.tar.gz: 62d3623c959bfd6e7ef508d29fdaea77af73afcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9276e529f80e01a205b232cf17d740ac044682e745eb04b977d914a97e365f009c7f4ba0541eb84458474ae4046dadac92c0771252c4fa431e3c70023938092
|
7
|
+
data.tar.gz: 8c425ffc11a4c5111904ff710548bb5d693f58d0e8b3cf8de507d8e52b753511dfff9bbb546bf122dfdf53c0f5f11a347cd2f1c3a247a817eb66054cae5a416f
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ 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
51
|
```ruby
|
52
52
|
mailer = Leadersend::Mail.new to: self.email, from: from, fromname: fromname, subject: subject, template_path: template_path, locals: locals, title: title
|
53
53
|
```
|
@@ -57,12 +57,12 @@ to: "example@email.com"
|
|
57
57
|
from: "coworker@company.com"
|
58
58
|
fromname: "Bob"
|
59
59
|
subject: "Friday party!"
|
60
|
-
template_path
|
61
|
-
title
|
62
|
-
locals
|
60
|
+
template_path: "delivery/partials/party_markup"
|
61
|
+
title: "It is friday!"
|
62
|
+
locals: {variable: value, another_variable: different_value} # These will be made available in the template
|
63
63
|
```
|
64
64
|
|
65
|
-
Call the
|
65
|
+
Call the *#send* method on the instantiated objec to send an email. This method returns a hash with response
|
66
66
|
```ruby
|
67
67
|
sent_mail_hash = mailer.send
|
68
68
|
```
|
data/lib/leadersend.rb
CHANGED
data/lib/leadersend/mailer.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Leadersend
|
2
2
|
class Mail
|
3
3
|
def initialize to: nil, from: nil, fromname: nil, subject: "System", template_path: nil, locals: {}, title: "System"
|
4
|
-
@api_email_url =
|
5
|
-
@api_user =
|
6
|
-
@api_key =
|
4
|
+
@api_email_url = Leadersend.config.api_url
|
5
|
+
@api_user = Leadersend.config.username
|
6
|
+
@api_key = Leadersend.config.api_key
|
7
7
|
@to = to
|
8
8
|
@subject = subject
|
9
9
|
@template_path = template_path
|
data/lib/leadersend/version.rb
CHANGED
data/spec/tests/basic_spec.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# rspec spec/tests/basic_spec.rb
|
2
2
|
describe "Leadersend" do
|
3
|
-
it "#root returns gem root" do
|
4
|
-
expect(Leadersend.root).to eq File.expand_path("../../..", __FILE__)
|
5
|
-
end
|
6
|
-
|
7
3
|
describe "config" do
|
8
4
|
it "default username should be ok" do
|
9
5
|
expect(Leadersend.config.username).to eq "example@domain.com"
|