-
Notifications
You must be signed in to change notification settings - Fork 264
/
Copy pathpdf-template-alt-4.yml
78 lines (77 loc) · 1.76 KB
/
pdf-template-alt-4.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
metadata:
title: Fill fields with code
short title: Fill
documentation: "https://docassemble.org/docs/documents.html#template code"
example start: 8
example end: 9
---
objects:
recipient: Individual
---
question: |
Assembling a document from a PDF
template
subquestion: |
This interview will fill fields in
a PDF template. You can
[download the template] to see what
it looks like.
[download the template]: ${ url_of('letter.pdf') }
field: introduction_shown
---
question: |
To whom shall the letter be sent?
fields:
- First Name: recipient.name.first
- Last Name: recipient.name.last
---
question: |
What is the address of ${ recipient }?
fields:
- Address: recipient.address.address
- Unit: recipient.address.unit
required: False
- City: recipient.address.city
- State: recipient.address.state
code: |
states_list()
- Zip: recipient.address.zip
required: False
---
question: |
What is the subject of the letter?
field: subject_of_letter
choices:
- Sales of oranges in Q4 2016
- Pedantry and pedagogy
- Tulips, tiptoes, and soil erosion
- Breakfast cereals in late antiquity
---
question: |
What type of letter do you
want to send?
field: letter_type
choices:
- Litigation threat: threat
- Happy birthday: birthday
- Other: other
---
mandatory: true
code: |
introduction_shown
---
mandatory: True
question: Here is your document.
attachment:
pdf template file: letter.pdf
code: letter_variables
---
code: |
letter_variables = {}
letter_variables['letter_date'] = today()
if letter_type == 'threat':
letter_variables['subject_line'] = "Litigation hold"
else:
letter_variables['subject_line'] = "Matter we discussed"
letter_variables['recipient_address'] = recipient.address_block()
reconsider: True