Skip to content

Commit 58ae93a

Browse files
authored
Update USE_CASES.md
Was missing the subject in the template and the dynamic data for the subject.
1 parent 8a97abe commit 58ae93a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

USE_CASES.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ Template ID (replace with your own):
1717
```text
1818
d-2c214ac919e84170b21855cc129b4a5f
1919
```
20+
Email Subject:
2021

22+
```text
23+
{{subject}}
24+
```
2125
Template Body:
2226

2327
```html
@@ -49,6 +53,7 @@ public class Example {
4953
mail.setTemplateId("d-2c214ac919e84170b21855cc129b4a5f");
5054

5155
Personalization personalization = new Personalization();
56+
personalization.addDynamicTemplateData("subject", "Testing Templates");
5257
personalization.addDynamicTemplateData("name", "Example User");
5358
personalization.addDynamicTemplateData("city", "Denver");
5459
personalization.addTo(new Email("test@example.com"));
@@ -89,7 +94,7 @@ public class Example {
8994
\"personalizations\":
9095
[{
9196
\"to\": [{\"email\": \"test@example.com\"}],
92-
\"dynamic_template_data\": {\"name\": \"Example User\", \"city\": \"Denver\"}
97+
\"dynamic_template_data\": {\"subject\": \"Testing Templates\",\"name\": \"Example User\", \"city\": \"Denver\"}
9398
}],
9499
\"template_id\": \"d-2c214ac919e84170b21855cc129b4a5f\"}");
95100
Response response = sg.api(request);

0 commit comments

Comments
 (0)