| 1 | package Document::eSign::Docusign::requestSignatureFromTemplate; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | Document::eSign::Docusign::requestSignatureFromTemplate - Uses a template to create and send a new envelope. | ||||||||||
| 10 | |||||||||||
| 11 | =head1 VERSION | ||||||||||
| 12 | |||||||||||
| 13 | Version 0.02 | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | =head1 functions | ||||||||||
| 18 | |||||||||||
| 19 | =head2 requestSignatureFromTemplate($parent, $vars) | ||||||||||
| 20 | |||||||||||
| 21 | my $response = $ds->requestSignatureFromTemplate( | ||||||||||
| 22 | { | ||||||||||
| 23 | accountId => $ds->accountid, | ||||||||||
| 24 | emailSubject => 'Hello Signer World!', | ||||||||||
| 25 | emailBlurb => 'Please sign my document.', | ||||||||||
| 26 | templateId => 'GUID-OF-TEMPLATE-FROM-TEMPLATES', | ||||||||||
| 27 | templateRoles => [ | ||||||||||
| 28 | { | ||||||||||
| 29 | email => 'somebody@somedomain.org', | ||||||||||
| 30 | name => 'Joe Somebody', | ||||||||||
| 31 | roleName => 'Signer1', # Corresponds to template signer ID. | ||||||||||
| 32 | } | ||||||||||
| 33 | ], | ||||||||||
| 34 | status => 'sent' | ||||||||||
| 35 | } | ||||||||||
| 36 | ); | ||||||||||
| 37 | |||||||||||
| 38 | print "Got envelopeId: " . $response->{envelopeId} . "\n"; | ||||||||||
| 39 | |||||||||||
| 40 | For more complicated examples, refer to Docusign's API Documentation. | ||||||||||
| 41 | |||||||||||
| 42 | =cut | ||||||||||
| 43 | |||||||||||
| 44 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 45 | 0 | ▶ | carp("Got sign template request: " . Dumper(@_)) if $_[1]->debug; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 0 | my $class = shift; | |||||||||
| 47 | 0 | my $main = shift; | |||||||||
| 48 | 0 | my $vars = shift; | |||||||||
| 49 | 0 | my $documentfh = shift; | |||||||||
| 50 | |||||||||||
| 51 | 0 | my $self = bless {}, $class; | |||||||||
| 52 | |||||||||||
| 53 | 0 | my $uri = '/envelopes'; | |||||||||
| 54 | |||||||||||
| 55 | 0 | my $creds = $main->buildCredentials(); | |||||||||
| 56 | |||||||||||
| 57 | 0 | my $response = $main->sendRequest('POST', 'application/json', $creds, $main->baseUrl . $uri, $vars); | |||||||||
| 58 | |||||||||||
| 59 | 0 | return $response; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | |||||||||||
| 63 | 1 | 1; | |||||||||