[Question] disable download of document by the end of interview, e-mail it instead
I couldn't reach the slack group (apparently the link has expired), so I will post my question here.
The 'attachment' block is the one that sets the option for assembling the document from a docx template, but it also necessarily returns a link to the documents, so that the user, after competing the interview, download the documents.
I wonder if it is possible to have docassemble send the assembled documents by e-mail instead -- my idea is that they are first sent to someone for review.
The documentation mentions an 'assemble_docx()' function, but it is not clear if it could be used to that purpose.
You don't need to use assemble_docx(). Just define your assembled document with a standalone attachment block and e-mail it with a call to the send_email() function.
mandatory: True
code: |
email_sent
final_screen
---
attachment:
variable name: assembled_document
docx template file: my_template.docx
---
template: email_template
subject: A document
content: |
Here is a document that someone created. Please review it.
---
code: |
send_email(to="[email protected]", template=email_template, attachments=[assembled_document.docx])
email_sent = True
---
event: final_screen
question: Thanks!
Sorry about the Slack link. The link used to be permanent but then Slack changed the policy so that they expire after 30 days and I forgot to update it on the web site. I just updated the link on the web site.
https://join.slack.com/t/docassemble/shared_invite/zt-j64q2cxy-jfVj0P8zVMt_421sNj95Ng
Thank you very much!