Python 未使用状态更改为“已发送”的docusign sender view api向收件人发送电子邮件
这是我的发件人视图,我在其中创建信封作为草稿,并在“编辑发件人”视图中打开它并发送,但收件人没有收到电子邮件Python 未使用状态更改为“已发送”的docusign sender view api向收件人发送电子邮件,python,flask,docusignapi,Python,Flask,Docusignapi,这是我的发件人视图,我在其中创建信封作为草稿,并在“编辑发件人”视图中打开它并发送,但收件人没有收到电子邮件 @app.route('/sender', methods = ['POST']) def sender1(): if request.method == 'POST': name = request.form['name'] email = request.form['email'] fi
@app.route('/sender', methods = ['POST'])
def sender1():
if request.method == 'POST':
name = request.form['name']
email = request.form['email']
filename1 = pdf2.save(request.files['file'])
subject = request.form['subject']
body = request.form['body']
path1 = pdf2.path(filename1)
url1 = pdf2.url(filename1)
remoteFile1 = urllib.request.urlopen(url1).read()
login_information = client.login_information()
signers = [
models.Signer(
email=email,
name=name,
recipientId=1,
clientUserId=str(uuid.uuid4()), # Something unique in your database.
emailSubject=subject,
emailBody=body,
supportedLanguage='en')]
session['email']=email
session['name']=name
session['subject']=subject
session['body']=body
with open(path1, 'rb') as pdf:
envelope = models.Envelope(
documents=[
models.Document(
name='document.pdf',
documentId=1,
data=pdf,
)
],
emailSubject=subject,
emailBlurb='request for signing',
status=models.Envelope.STATUS_CREATED,
recipients=signers,
)
client.create_envelope_from_documents(envelope)
url = client.sender_edit_view(envelope.envelopeId)
models.Envelope(status=models.Envelope.STATUS_SENT)
data=url['url']
#data = data.replace('send=1','send=0')
#print(data)
return redirect(data)
这是用于调用api的发件人编辑视图
def sender_edit_view(self,envelopeId=''):
"""POST to {account}/envelopes/{envelopeId}/views/recipient.
This is the method to start embedded signing for recipient.
Return JSON from DocuSign response.
"""
authenticationMethod=None
returnUrl='http://127.0.0.1:5000/callback'
if not self.account_url:
self.login_information()
url = '/accounts/{accountId}/envelopes/{envelopeId}/views/correct' \
.format(accountId=self.account_id,envelopeId=envelopeId,
)
if authenticationMethod is None:
authenticationMethod = 'email'
data = {
'authenticationMethod': authenticationMethod,
'returnUrl': returnUrl,
}
return self.post(url, data=data, expected_status_code=201)
如何使用api向收件人发送电子邮件。我也尝试使用创建正确的api,并尝试更新收件人,但电子邮件仍然没有被发送 问题不在于发件人视图,问题在于签名人被标记为嵌入式签名人(没有向签名仪式发送电子邮件邀请) 您的收件人没有收到电子邮件邀请,因为您正在为他们设置
clientUserId
属性
设置clientUserId
会产生许多影响:
- 签名者成为嵌入式签名者
- 未发送签名仪式的电子邮件邀请
- 在您为签名者创建签名仪式后,签名者将通过嵌入式签名仪式进行签名
- clientUserId设置值的元数据由签名者维护,以用于应用程序
- 不要设置clientUserId属性
- 如果要在DocuSign中的receipient记录和您自己的应用程序之间维护元数据,请使用收件人的
属性 (这不适用于您的用例,因为您正在使用uuid。但它可能适用于本答案的其他读者。)customFields