hellosign / hellosign-php-sdk

A PHP SDK for HelloSign's API
MIT License
85 stars 38 forks source link

Add merge_field support to embedded template editing #122

Closed djhype closed 1 year ago

djhype commented 2 years ago

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's edit_url. However, adding merge fields to the Template object and passing the Template object to the Client::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 the merge_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 the Client::getEmbeddedEditUrl() method so this likely has low-to-no impact anywhere else. The code snippet is exactly the same as the handling of the Template::merge_fields property in the Template::toEmbeddedDraftParams() method. Thus, the code isn't very DRY. However, all of the toXxParams() methods in the Template class aren't very dry. If you like, I will amend this PR so that the various toXxParams() methods all use a single method to generate the valid parameter array.

OnionKnightN commented 2 years 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.

CLAassistant commented 2 years ago

CLA assistant check
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.


Eric Schmiedel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

jtreminio-dropbox commented 1 year ago

Please use the new OpenAPI SDK: https://packagist.org/packages/dropbox/sign