-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31677ea
commit 3705080
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,5 +125,23 @@ def kitchen_sink | |
puts response.headers | ||
end | ||
|
||
def dynamic_template_data_hello_world | ||
mail = Mail.new | ||
mail.template_id = '' # a non-legacy template id | ||
mail.from = Email.new(email: '[email protected]') | ||
subject = 'Dynamic Template Data Hello World from the SendGrid Ruby Library' | ||
mail.subject = subject | ||
personalization = Personalization.new | ||
personalization.add_to(Email.new(email: '[email protected]', name: 'Example User')) | ||
personalization.add_dynamic_template_data({ | ||
"variable" => [ | ||
{"foo" => "bar"}, {"foo" => "baz"} | ||
] | ||
}) | ||
mail.add_personalization(personalization) | ||
end | ||
|
||
hello_world | ||
kitchen_sink | ||
dynamic_template_data_hello_world | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters