def create_envelope_from_composite_template(options={})
      file_params = {}

      if options[:files]
        ios = create_file_ios(options[:files])
        file_params = create_file_params(ios)
      end

      post_hash = {
        emailBlurb:        "#{options[:email][:body] if options[:email]}",
        emailSubject:      "#{options[:email][:subject] if options[:email]}",
        status:             options[:status],
        brandId:            options[:brand_id],
        eventNotification:  get_event_notification(options[:event_notification]),
        allowReassign:      options[:allow_reassign],
        compositeTemplates: get_composite_template(options[:server_template_ids], options[:signers], options[:files])
      }

      post_body = post_hash.to_json

      uri = build_uri("/accounts/#{acct_id}/envelopes")

      http = initialize_net_http_ssl(uri)

      request = initialize_net_http_multipart_post_request(
                  uri, post_body, file_params, headers(options[:headers])
                )

      response = http.request(request)
      generate_log(request, response, uri)
      JSON.parse(response.body)
    end
def create_envelope_from_composite_template(options={})
      file_params = {}

      if options[:files]
        ios = create_file_ios(options[:files])
        file_params = create_file_params(ios)
      end

      post_hash = {
        emailBlurb:        "#{options[:email][:body] if options[:email]}",
        emailSubject:      "#{options[:email][:subject] if options[:email]}",
        status:             options[:status],
        brandId:            options[:brand_id],
        eventNotification:  get_event_notification(options[:event_notification]),
        allowReassign:      options[:allow_reassign],
        compositeTemplates: get_composite_template(options[:server_template_ids], options[:signers], options[:files])
      }

      post_body = post_hash.to_json

      uri = build_uri("/accounts/#{acct_id}/envelopes")

      http = initialize_net_http_ssl(uri)

      request = initialize_net_http_multipart_post_request(
                  uri, post_body, file_params, headers(options[:headers])
                )

      response = http.request(request)
      generate_log(request, response, uri)
      JSON.parse(response.body)
    end
Public: create an envelope for delivery from a composite template

 headers               - Optional hash of headers to merge into the existing
                         required headers for a POST request.
 status                - Options include: 'sent', or 'created' and
                         determine if the envelope is sent out immediately or
                         stored for sending at a later time
 email/body            - Sets the text in the email body
 email/subject         - Sets the text in the email subject line
 files                 - Sets documents to be used instead of inline or server templates
 signers               - See get_template_roles/get_inline_signers for a list
                         of options to pass.
 headers               - Optional hash of headers to merge into the existing
                         required headers for a multipart request.
 server_template_ids   - Array of ids for templates uploaded to DocuSign. Templates
                         will be added in the order they appear in the array.

 Returns a JSON parsed response body containing the envelope's:
   envelopeId - autogenerated ID provided by Docusign
   uri - the URI where the template is located on the DocuSign servers
   statusDateTime - The date/time the envelope was created
   status         - Sent, created, or voided