feat: add custom email headers (#260)

This commit is contained in:
KM Koushik
2025-09-28 21:33:45 +10:00
committed by GitHub
parent 1a00999bf0
commit 890ad72057
15 changed files with 202 additions and 30 deletions
+16
View File
@@ -1140,6 +1140,14 @@
"nullable": true,
"minLength": 1
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string",
"minLength": 1
},
"description": "Custom headers to included with the emails"
},
"attachments": {
"type": "array",
"items": {
@@ -1288,6 +1296,14 @@
"nullable": true,
"minLength": 1
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string",
"minLength": 1
},
"description": "Custom headers to included with the emails"
},
"attachments": {
"type": "array",
"items": {
+5
View File
@@ -57,8 +57,13 @@ icon: node-js
subject: "useSend email",
html: "<p>useSend is the best open source product to send emails</p>",
text: "useSend is the best open source product to send emails",
headers: {
"X-Campaign": "welcome",
},
});
```
> Custom headers are forwarded as-is. useSend only manages the `X-Usesend-Email-ID` and `References` headers.
</Step>
</Steps>
+3
View File
@@ -41,12 +41,15 @@ payload: types.EmailCreate = {
"from": "no-reply@yourdomain.com",
"subject": "Welcome",
"html": "<strong>Hello!</strong>",
"headers": {"X-Campaign": "welcome"},
}
data, err = client.emails.send(payload)
print(data or err)
```
useSend forwards your custom headers to SES. Only the `X-Usesend-Email-ID` and `References` headers are managed automatically.
Attachments and scheduling:
```python