Closed djhype closed 1 year ago
Thank you for submitting this pull request! We are having this reviewed internally and will write back to you on the update of this fix as soon as possible.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Please use the new OpenAPI SDK: https://packagist.org/packages/dropbox/sign
Per the API documentation entry for embedded templates (https://app.hellosign.com/api/embeddedTemplatesWalkthrough#EmbeddedTemplatesEditingATemplate), the API supports passing a
merge_fields
property when retrieving a embedded template'sedit_url
. However, adding merge fields to the Template object and passing the Template object to theClient::getEmbeddedEditUrl()
method did not result in a change to the template's merge fields. This PR adds support for changing merge_fields when updating an embedded template.The
merge_fields
change act as an atomic update in that ALL fields (both existing and new) must be included in themerge_fields
JSON string. This appears to be the intended functionality as I experienced this when issuing a cURL command directly to the API.According to PHPStorm, the only usages of the
Template::toParams()
method is in theClient::getEmbeddedEditUrl()
method so this likely has low-to-no impact anywhere else. The code snippet is exactly the same as the handling of theTemplate::merge_fields
property in theTemplate::toEmbeddedDraftParams()
method. Thus, the code isn't very DRY. However, all of thetoXxParams()
methods in theTemplate
class aren't very dry. If you like, I will amend this PR so that the varioustoXxParams()
methods all use a single method to generate the valid parameter array.