Skip to content

Instantly share code, notes, and snippets.

@nonprofittechy
Created November 6, 2018 19:18
Show Gist options
  • Save nonprofittechy/d24a36a049c6ff56a467b81d40c19514 to your computer and use it in GitHub Desktop.
Save nonprofittechy/d24a36a049c6ff56a467b81d40c19514 to your computer and use it in GitHub Desktop.
---
modules:
- docassemble.base.util
---
mandatory: True
code: |
menu_items = [ {'url': url_ask(['share_fields', 'share_success', {'recompute': ['share_email','sent_sharing_email','share_cell','sent_sharing_text']}]), 'label': 'Share interview'}]
---
code: |
if share_email:
sent_sharing_email = send_email(to=share_email,template=sharing_email_template)
else:
sent_sharing_email = False
if share_cell:
sent_sharing_text = send_sms(to=share_cell,template=interview_link)
else:
sent_sharing_text = False
---
template: interview_link
content: |
Click the link below to continue the interview on your phone.
${interview_url()}
---
template: sharing_email_template
subject: |
You were sent the link for a Docassemble interview
content: |
Someone who was completing an interview sent you this link.
Click [here](${interview_url()}) to keep working on the interview.
---
decoration: share
question: |
Share this interview
subquestion: |
You can continue this interview on another device, or share it with
someone who will help you finish it. Choose any of the options below to share
the interview.
Right-click and copy [this link](${interview_url()}).
% if not device().is_mobile:
Use your phone's camera to point at this barcode. Click the link that appears
in the camera's viewfinder.
<center>
${interview_url_as_qr()}
</center>
% endif
fields:
- Text a link to this phone number: share_cell
required: false
- Email a link to this address: share_email
required: false
continue button field: share_fields
---
need:
- sent_sharing_email
- sent_sharing_text
question: |
Sharing links sent
subquestion: |
We sent a link to the interview to the phone number or email address
you gave us. It may take several seconds to arrive.
field: share_success
---
Mandatory: True
question: All done
subquestion: |
Use the menu option "Share Interview" to share this with someone else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment