Skip to content

Commit

Permalink
Merge pull request #29 from riichard/master
Browse files Browse the repository at this point in the history
Added support for dynamic_template_data
  • Loading branch information
Andrewangeta committed Jan 27, 2019
2 parents 3b71cae + 82bf41f commit 4fca9d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/SendGrid/Models/Personalization.swift
Expand Up @@ -20,6 +20,9 @@ public struct Personalization: Content {
/// A collection of key/value pairs following the pattern "substitution_tag":"value to substitute".
public var substitutions: [String: String]?

/// A collection of key/value pairs following the pattern "key":"value" to substitute handlebar template data
public var dynamicTemplateData: [String: String]?

/// Values that are specific to this personalization that will be carried along with the email and its activity data.
public var customArgs: [String: String]?

Expand All @@ -32,6 +35,7 @@ public struct Personalization: Content {
subject: String? = nil,
headers: [String: String]? = nil,
substitutions: [String: String]? = nil,
dynamicTemplateData: [String: String]? = nil,
customArgs: [String: String]? = nil,
sendAt: Date? = nil) {
self.to = to
Expand All @@ -40,6 +44,7 @@ public struct Personalization: Content {
self.subject = subject
self.headers = headers
self.substitutions = substitutions
self.dynamicTemplateData = dynamicTemplateData
self.customArgs = customArgs
self.sendAt = sendAt
}
Expand All @@ -52,6 +57,7 @@ public struct Personalization: Content {
case headers
case substitutions
case customArgs = "custom_args"
case dynamicTemplateData = "dynamic_template_data"
case sendAt = "send_at"
}
}

0 comments on commit 4fca9d0

Please sign in to comment.