Skip to content

Commit 6d791ad

Browse files
amalco2mtgray-sp
andauthored
Update cc-bcc-with-rest-api.md (#777)
* Update cc-bcc-with-rest-api.md Adding details on using CC and BCC with stored templates. * Update content/docs/faq/cc-bcc-with-rest-api.md Co-authored-by: Matt Gray <[email protected]> * Update content/docs/faq/cc-bcc-with-rest-api.md Co-authored-by: Matt Gray <[email protected]> --------- Co-authored-by: Matt Gray <[email protected]>
1 parent 2f86e0a commit 6d791ad

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

content/docs/faq/cc-bcc-with-rest-api.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
lastUpdated: "02/08/2020"
2+
lastUpdated: "10/16/2024"
33
title: "Using CC and BCC with the REST API"
44
description: "Before getting started please read What are the differences between CC BCC and archive recipients Note to use CC BCC and Archiving with SMTP check out our SMTP API reference documentation Note Please be advised that CC and BCC messages count towards your usage What is CC CC is a..."
55
---
@@ -124,3 +124,77 @@ Finally, here's an example with both CC and BCC recipients.  You set header_to
124124
}
125125
}
126126
```
127+
128+
### Using CC and BCC with Stored Templates
129+
130+
Header values must be set directly within the stored template, so manually adding CC and BCC will not be honored when a stored template is used. To use CC and BCC with a stored template, the template must be created through the API.
131+
132+
One method is to use substitution data for your templates that you want to have a CC line. For example, you could create a template like this:
133+
134+
```json
135+
{
136+
"id": "cc_template_3",
137+
"name": "cc_template_3",
138+
"description": "",
139+
"published": true,
140+
"options": {
141+
"click_tracking": true,
142+
"open_tracking": false
143+
},
144+
"shared_with_subaccounts": false,
145+
"last_update_time": "2018-12-14T17:15:12+00:00",
146+
"last_use": "2018-12-14T17:15:49+00:00",
147+
"has_published": true,
148+
"has_draft": false,
149+
"content": {
150+
"from": "[email protected]",
151+
"headers": {
152+
"CC": "{{ cc_data or '' }}"
153+
},
154+
"subject": "CC 2",
155+
"text": " cc email"
156+
}
157+
}
158+
```
159+
160+
Then, for the transmission, set the substitution data for the CC:
161+
162+
```json
163+
{
164+
"options": {
165+
"open_tracking": true,
166+
"click_tracking": true,
167+
"transactional": true
168+
},
169+
"campaign_id": "mycampaign-msys",
170+
"return_path": "[email protected]",
171+
"header_from": "Single Recipient",
172+
"metadata": {
173+
"key": "value"
174+
},
175+
"recipients": [
176+
{
177+
"address": {
178+
"email": "[email protected]"
179+
},
180+
"tags": [
181+
"greeting",
182+
"prehistoric",
183+
"fred",
184+
"flintstone"
185+
],
186+
"header_to": "Wilma Flintstone",
187+
"metadata": {
188+
"place": "Bedrock",
189+
"host": "google.com"
190+
}
191+
}
192+
],
193+
"substitution_data": {
194+
"cc_data": "[email protected]"
195+
},
196+
"content": {
197+
"template_id": "cc_template_3"
198+
}
199+
}
200+
```

0 commit comments

Comments
 (0)