marketingcloud-mailer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/marketingcloud/mailer.rb +6 -2
- data/lib/marketingcloud/mailer/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: c43df6df704ba5d094a67bbdac8f951864556015
|
4
|
+
data.tar.gz: 6ce53d834407e6252a53521c73a0b22d719a70f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4e809e212a75a7eb053546380f15ba42ccf313b382c4f3faeb3660140274a5615a7f3fa1d14135564fa408a56fe2bd02660a03b3f46d01c4624f5a941a0a05f
|
7
|
+
data.tar.gz: 26116f746340f35c3e3885c8e10628fa3227abe2a839fc249bdbb742dd32c9bec2d5ca28ff8081a15f9586b84aa2190dd6dd87735ee7380bfc5bcea5167f3d5c
|
@@ -17,12 +17,16 @@ module Marketingcloud
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def deliver!(mail)
|
20
|
-
# key = mail['external_key'] || external_key
|
21
20
|
ts = ::ExactTargetRest::TriggeredSend.new(@session, external_key)
|
22
21
|
if mail.to.length != 1
|
23
22
|
raise ArgumentError.new('Marketingcloud::Mailer only accepts a single recipient')
|
24
23
|
end
|
25
|
-
|
24
|
+
html = if mail.body.raw_source.blank? && mail.body.parts.length >= 1
|
25
|
+
mail.body.parts.last.to_s
|
26
|
+
else
|
27
|
+
mail.body.raw_source
|
28
|
+
end
|
29
|
+
ts.send_one(email_address: mail.to.first, subscriber_attributes: { 'HTML' => html, 'Subject' => mail.subject, 'Preheader' => ''})
|
26
30
|
end
|
27
31
|
|
28
32
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marketingcloud-mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Smestad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|