Skip to content

Commit eb63d98

Browse files
committed
Merge pull request #41 from sendwithus/strict-render-support
Added support for strict flag on render endpoint
2 parents 5774ac6 + 1fd031a commit eb63d98

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ dist/*
1212
build/
1313
build/*
1414
*.egg-info
15+
16+
# IntelliJ
17+
.idea
18+
*.iml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ api.send_segment('tem_12345', 'seg_12345', email_data={'color': 'blue'})
340340
The render API allows you to render a template with data, using the exact same rendering workflow that Sendwithus uses when delivering your email.
341341

342342
```python
343-
api.render('tem_12345', { "amount": "$12.00" }, 'French-Version')
343+
api.render('tem_12345', { "amount": "$12.00" }, 'French-Version', strict=False)
344344
```
345345

346346
## expected response

sendwithus/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,28 @@ def start_batch(self):
585585
DEBUG=self.DEBUG,
586586
json_encoder=self._json_encoder)
587587

588-
def render(self, email_id, email_data, version_id=None, version_name=None):
588+
def render(
589+
self,
590+
email_id,
591+
email_data,
592+
version_id=None,
593+
version_name=None,
594+
strict=False):
595+
589596
payload = {
590597
"template_id": email_id,
591598
"template_data": email_data
592599
}
600+
593601
if version_id:
594602
payload['version_id'] = version_id
595603

596604
if version_name:
597605
payload['version_name'] = version_name
598606

607+
if strict:
608+
payload['strict'] = strict
609+
599610
return self._api_request(self.RENDER_ENDPOINT, self.HTTP_POST, payload=payload)
600611

601612

sendwithus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '1.5.5'
1+
version = '1.6.5'

0 commit comments

Comments
 (0)