I’m trying to automate sending an envelope with multiple documents attached to it. However, when the email is sent, only the 1st document is seen.
documents = =]
index = 1
for pdf in listdir(flattenedFolder):
if isfile(join(flattenedFolder, pdf)) and pdfdlen(pdf)-4 : len(pdf)] == '.pdf':
with open(join(flattenedFolder, pdf), "rb") as file:
doc_docx_bytes = file.read()
doc_b64 = base64.b64encode(doc_docx_bytes).decode("ascii")
document = Document( # create the DocuSign document object
document_base64=doc_b64,
name = pdfd0 : len(pdf)-4],
file_extension="pdf",
document_id = index,
order=index
)
index += 1
documents.append(document)
envelope_definition.documents = documents