Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[116] Add support for 'notification' Envelope attribute. #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pydocusign/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class Envelope(DocuSignObject):
attributes = ['documents', 'emailBlurb', 'emailSubject',
'eventNotification', 'recipients', 'templateId',
'templateRoles', 'status', 'envelopeId', 'userId',
'enableWetSign']
'enableWetSign', 'notification']
required_attributes = ['envelopeId', 'userId']
attribute_defaults = {
'emailBlurb': '',
Expand Down Expand Up @@ -437,6 +437,8 @@ def to_dict(self):
}
if self.eventNotification:
data['eventNotification'] = self.eventNotification.to_dict()
if self.notification:
data['notification'] = self.notification
if self.templateId:
data.update({
'templateId': self.templateId,
Expand Down
28 changes: 28 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,31 @@ def test_void_method_calls_api(self):
envelope.void('reason')

client.void_envelope.assert_called_once_with('fake-envelope-id', 'reason')


def test_serialize_envelope_with_notification(self):
document = Document(
documentId=2,
name='document.pdf')
envelope = Envelope(
documents=[document],
emailBlurb='This is the email body',
emailSubject='This is the email subject',
status=ENVELOPE_STATUS_DRAFT,
notification={
'expirations': {
'expireEnabled': True,
'expireAfter': 365,
'expireWarn': 5,
},
},
)
self.assertDictContainsSubset({
'notification': {
'expirations': {
'expireEnabled': True,
'expireAfter': 365,
'expireWarn': 5,
},
},
}, envelope.to_dict())