sendgrid-actionmailer 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d255eeab037f499229ba0e4d50e5882db6aa90a
4
- data.tar.gz: d380795abfc9a200f86ac81d860f2cafd6c7c16f
3
+ metadata.gz: d0cf44faa71a46698dd397f001b0ed5c07f00edc
4
+ data.tar.gz: 1feedab0fd41d4d9dbff84441f272bab024bf08d
5
5
  SHA512:
6
- metadata.gz: fc7162c1e60fa03360e80a18e4d84a676b38b1593eef4b3b2e3671fda72b13cd67ea9ae227758bfdd69b81f67fbe1562587141ad7bf5e27b810a7cfcc65ca5e2
7
- data.tar.gz: 28913dbd6e4f0d375e34d3341c2e44b51483c5025bd427e722278acc36185e78def4bcc8057bfe96d7de80b9f7872fa292dde1576c575c969d26565c1db2e92d
6
+ metadata.gz: 603221943d0dd4cc9446e68f3c77441930efa6f90545e7255e4af56eed0ab7fcf81e66d94ba6fbc72c9f8347db0922f54558ecb9ec6ea1f39ddb0a042520af51
7
+ data.tar.gz: 2976d343386bb783ed92088d6a3417175ed61441562661d71dac703298bf093e6122b84f6509f2bb010b07cbee4a474067e35e8cb19691cb0cff29e4beb2b602
data/README.md CHANGED
@@ -228,3 +228,5 @@ Sendgrid unfortunately uses <% %> for their default substitution syntax, which m
228
228
  * `<a href="%asm_group_unsubscribe_raw_url%">Unsubscribe</a>`
229
229
  * `<a href="%asm_global_unsubscribe_raw_url%">Unsubscribe from List</a>`
230
230
  * `<a href="%asm_preferences_raw_url%">Manage Email Preferences</a>`
231
+
232
+ Note: This feature, and substitutions in general, do not work in combination with dynamic templates.
@@ -1,3 +1,3 @@
1
1
  module SendGridActionMailer
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
@@ -23,7 +23,7 @@ module SendGridActionMailer
23
23
  sendgrid_mail = Mail.new.tap do |m|
24
24
  m.from = to_email(mail.from)
25
25
  m.reply_to = to_email(mail.reply_to)
26
- m.subject = mail.subject
26
+ m.subject = mail.subject || ""
27
27
  # https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html
28
28
  m.add_personalization(to_personalizations(mail))
29
29
  end
@@ -83,10 +83,11 @@ module SendGridActionMailer
83
83
 
84
84
  if mail['dynamic_template_data']
85
85
  p.add_dynamic_template_data(json_parse(mail['dynamic_template_data'].value))
86
+ else
87
+ p.add_substitution(Substitution.new(key: "%asm_group_unsubscribe_raw_url%", value: "<%asm_group_unsubscribe_raw_url%>"))
88
+ p.add_substitution(Substitution.new(key: "%asm_global_unsubscribe_raw_url%", value: "<%asm_global_unsubscribe_raw_url%>"))
89
+ p.add_substitution(Substitution.new(key: "%asm_preferences_raw_url%", value: "<%asm_preferences_raw_url%>"))
86
90
  end
87
- p.add_substitution(Substitution.new(key: "%asm_group_unsubscribe_raw_url%", value: "<%asm_group_unsubscribe_raw_url%>"))
88
- p.add_substitution(Substitution.new(key: "%asm_global_unsubscribe_raw_url%", value: "<%asm_global_unsubscribe_raw_url%>"))
89
- p.add_substitution(Substitution.new(key: "%asm_preferences_raw_url%", value: "<%asm_preferences_raw_url%>"))
90
91
  end
91
92
  end
92
93
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-actionmailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eddie Zaneski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-20 00:00:00.000000000 Z
13
+ date: 2018-11-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mail