docusign_rest
docusign_rest copied to clipboard
Custom fields per signer not showing up in document
I have 2 signers on my document template that each have some custom fields, I duplicate them because there seems to be no way to have common custom fields since DocuSign asks that you specify a signer for your fields
So I add these custom fields to each signer in my envelope request, but they don't show up in the document when I go view it.
custom_fields = {
host_address: "Testing Host Address",
host_civil_status: "Host Civil Status",
host_id_number: "123HOSTID",
host_tax_number: "123HOSTTAX",
nomad_address: "Testing Nomad Address",
nomad_civil_status: "Nomad Civil Status",
nomad_id_number: "123NOMADID",
nomad_tax_number: "123NOMADTAX",
property_address: booking.listing.property.full_address,
property_deposit: (booking.deposit * booking.price).to_s,
property_description: "Property Description",
property_start_date: booking.start_date.strftime("%d/%m/%Y"),
property_end_date: booking.end_date.strftime("%d/%m/%Y"),
property_stay_length: distance_of_time_in_words(booking.start_date, booking.end_date),
property_montly_rent: booking.price.to_s,
}
@envelope = client.create_envelope_from_template(
status: 'sent',
email: {
subject: "The test email subject envelope",
body: "Envelope body content here"
},
template_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
signers: [
{
embedded: true,
name: booking.listing.user.name,
email: booking.listing.user.email,
role_name: 'Host',
custom_fields: custom_fields
},
{
embedded: true,
name: booking.user.name,
email: booking.user.email,
role_name: 'Nomad',
custom_fields: custom_fields
}
]
)