Skip to content

Commit b429949

Browse files
committed
changes to template creation
1 parent d69ee8d commit b429949

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/Controllers/Examples/WebForms/EG001CreateAndEmbedForm.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,7 @@ protected function createController(): void
9292
$this->askToCreateWebForm();
9393
}
9494

95-
$formId = "";
96-
foreach ($formList->getItems() as $item) {
97-
if ($item->getFormProperties()->getName() == self::WEB_FORM_EXAMPLE_TEMPLATE) {
98-
$formId = $item->getId();
99-
break;
100-
}
101-
}
95+
$formId = $formList->getItems()[0]->getId();
10296

10397
$webFormInstance = CreateAndEmbedFormService::createInstance(
10498
$this->clientService->FormInstanceManagementApi(),

src/Services/Examples/WebForms/CreateAndEmbedFormService.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static function createTemplate(
150150
$templateId = $templatesListResponse['envelope_templates'][0]['template_id'];
151151
$resultsTemplateName = $templatesListResponse['envelope_templates'][0]['name'];
152152
} else {
153-
$templateObject = CreateTemplateService::makeTemplateRequest(
153+
$templateObject = CreateAndEmbedFormService::makeTemplateRequest(
154154
$template_name,
155155
$demoDocsPath
156156
);
@@ -216,31 +216,31 @@ public static function makeTemplateRequest(
216216
]);
217217
$text = new Text([
218218
'document_id' => "1",
219-
'font_size' => "FullName",
219+
'tab_label' => "FullName",
220220
'anchor_string' => "/FullName/",
221221
'anchor_units' => "pixels",
222222
'anchor_x_offset' => "20",
223223
'anchor_y_offset' => "10"
224224
]);
225225
$text2 = new Text([
226226
'document_id' => "1",
227-
'font_size' => "PhoneNumber",
227+
'tab_label' => "PhoneNumber",
228228
'anchor_string' => "/PhoneNumber/",
229229
'anchor_units' => "pixels",
230230
'anchor_x_offset' => "20",
231231
'anchor_y_offset' => "10"
232232
]);
233233
$text3 = new Text([
234234
'document_id' => "1",
235-
'font_size' => "Company",
235+
'tab_label' => "Company",
236236
'anchor_string' => "/Company/",
237237
'anchor_units' => "pixels",
238238
'anchor_x_offset' => "20",
239239
'anchor_y_offset' => "10"
240240
]);
241241
$text4 = new Text([
242242
'document_id' => "1",
243-
'font_size' => "JobTitle",
243+
'tab_label' => "JobTitle",
244244
'anchor_string' => "/Title/",
245245
'anchor_units' => "pixels",
246246
'anchor_x_offset' => "20",
@@ -249,7 +249,7 @@ public static function makeTemplateRequest(
249249

250250
$dateSignedTabs = new DateSigned([
251251
'document_id' => "1",
252-
'font_size' => "DateSigned",
252+
'tab_label' => "DateSigned",
253253
'anchor_string' => "/Date/",
254254
'anchor_units' => "pixels",
255255
'anchor_x_offset' => "20",

0 commit comments

Comments
 (0)