feat: add custom email headers (#260)
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user