Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit 504ba87

Browse files
authored
Merge pull request #102 from HelloFax/AS-175
AS-175 Embedded Bulk Send Job
2 parents 97456dc + a96a753 commit 504ba87

File tree

2 files changed

+78
-4
lines changed

2 files changed

+78
-4
lines changed

lib/hello_sign/api/signature_request.rb

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,80 @@ def bulk_send_with_template(opts)
328328
HelloSign::Resource::BulkSendJob.new post('/signature_request/bulk_send_with_template', body: opts)
329329
end
330330

331+
# Creates an embedded BulkSendJob based off of the Template specified with the template_id parameter.
332+
# @option opts [Boolean] test_mode Indicates if this is a test BulkSendJob, its SignatureRequests will not be legally binding if set to 1. Defaults to 0. (optional)
333+
# @option opts [String] template_id The Template ID to use when creating the SignatureRequest.
334+
# * Use template_ids[%i%] if using multiple templates, replacing %i% with an integer to indicate the order of the Templates
335+
# @option opts [String] client_id The API App Client ID associated with this embedded BulkSendJob.
336+
# @option opts [String] title Assigns a title to the SignatureRequest. (optional)
337+
# @option opts [String] subject Sets the subject in the email sent to the signer(s). (optional)
338+
# @option opts [String] message Sets the message in the email sent to the signer(s). (optional)
339+
# @option opts [String] signing_redirect_url Redirects the signer(s) to this URL after completing the SignatureRequest. (optional)
340+
# @option opts [String] signer_file Uploads a CSV file defining values and options for signer fields. Required if signer_list is not used.
341+
# @option opts [String] signer_list A JSON array defining values and options for signer fields. Required if signer_file is not used.
342+
# @option opts [Array<Hash>] custom_fields An array of custom merge fields, representing those present on the Template. (optional)
343+
# * name (String) Custom field name or "Field Label"
344+
# * value (String) The value of the field. This data will appear on the SignatureRequest.
345+
# * editor (String) The signer name indicated on the Text Tag or form_fields_per_document that can edit the value of the field. (optional)
346+
# * required (Boolean) Determines if the field is required or not. (optional)
347+
# @option opts [Array<Hash>] ccs The individual(s) to be CC'd on the SignatureRequest. Required when a CC role exists for the Template.
348+
# * role (String) The CC role indicated on the Template. Note that the role name is case sensitive.
349+
# * email_address (String) CC Recipient's email address
350+
# @option opts [Hash] metadata Key-value data attached to the SignatureRequest. (optional)
351+
# @option opts [String] client_id The API App Client ID associated with the SignatureRequest. (optional)
352+
#
353+
# @return [HelloSign::Resource::BulkSendJob] a BulkSendJob
354+
#
355+
# @example
356+
# signature_request = @client.embedded_bulk_send_with_template(
357+
# test_mode: 1,
358+
# allow_decline: 0,
359+
# template_id: 'c26b8a16784a872da37ea946b9ddec7c1e11dff6',
360+
# client_id: 'b6b8e7deaf8f0b95c029dca049356d4a2cf9710a',
361+
# title: 'Purchase Order',
362+
# subject: 'Purchase Order',
363+
# message: 'Glad we could come to an agreement.',
364+
# metadata: {
365+
# client_id: '1234',
366+
# custom_text: 'NDA #9'
367+
# },
368+
# signer_list: [
369+
# {
370+
# signers: {
371+
# Client: {
372+
# name: 'George',
373+
# email_address: 'bulksend1@example.com'
374+
# }
375+
# },
376+
# custom_fields: {
377+
# address: '100 Grand'
378+
# }
379+
# },
380+
# {
381+
# signers: {
382+
# Client: {
383+
# name: 'Mary',
384+
# email_address: 'bulksend2@example.com'
385+
# }
386+
# }
387+
# }
388+
# ],
389+
# ccs: [
390+
# {
391+
# email_address: 'accounting@example.com',
392+
# role: 'Accounting'
393+
# }
394+
# ]
395+
# )
396+
def embedded_bulk_send_with_template(opts)
397+
prepare_bulk_signers opts
398+
prepare_ccs opts
399+
prepare_templates opts
400+
prepare_custom_fields opts
401+
402+
HelloSign::Resource::BulkSendJob.new post('/signature_request/bulk_create_embedded_with_template', body: opts)
403+
end
404+
331405
# Sends an email reminder to the signer about the SignatureRequest.
332406
# @option opts [String] signature_request_id Indicates the ID of the SignatureRequest to send a reminder.
333407
# @option opts [String] email_address The email address of the signer who will receive a reminder.
@@ -380,7 +454,7 @@ def signature_request_files(opts)
380454
if opts[:file_type]
381455
path = path + "?file_type=#{opts[:file_type]}"
382456
end
383-
457+
384458
if opts[:get_url]
385459
separator = opts[:file_type].nil? ? '?' : '&'
386460
path = path + "#{separator}get_url=#{opts[:get_url]}"
@@ -396,7 +470,7 @@ def signature_request_files(opts)
396470
# If form_fields_per_document is not specified or use_text_tags is not enabled, a signature page will be affixed at the end.
397471
# See our Embedded Signing Walkthrough for more information on Embedded Signing: https://app.hellosign.com/api/embeddedSigningWalkthrough.
398472
# @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. Defaults to 0. (optional)
399-
# @option opts [String] client_id The API App Client ID associated with the this embedded SignatureRequest.
473+
# @option opts [String] client_id The API App Client ID associated with this embedded SignatureRequest.
400474
# @option opts [Array<String>] files Use files to indicate the uploaded file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both.
401475
# @option opts [Array<String>] file_urls Use file_urls to have HelloSign download the file(s) to send for signature. Currently we only support use of either the files parameter or file_urls parameter, not both.
402476
# @option opts [String] title Assigns a title to the SignatureRequest. (optional)
@@ -489,7 +563,7 @@ def create_embedded_signature_request(opts)
489563
# Creates a new SignatureRequest based on the given Template to be signed in an embedded iFrame.
490564
# See our Embedded Signing Walkthrough for more information on Embedded Signing: https://app.hellosign.com/api/embeddedSigningWalkthrough.
491565
# @option opts [Boolean] test_mode Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. Defaults to 0. (optional)
492-
# @option opts [String] client_id The API App Client ID associated with the this embedded SignatureRequest.
566+
# @option opts [String] client_id The API App Client ID associated with this embedded SignatureRequest.
493567
# @option opts [String] template_id The Template ID to use when creating the SignatureRequest.
494568
# * Use template_ids[%i%] if using multiple templates, replacing %i% with an integer to indicate the order of the Templates
495569
# @option opts [String] title Assigns a title to the SignatureRequest. (optional)

lib/hello_sign/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
# SOFTWARE.
2222

2323
module HelloSign
24-
VERSION = '3.7.6'
24+
VERSION = '3.7.7'
2525
end

0 commit comments

Comments
 (0)