PluginProbe
The Innovative Form Builder – IvyForms / 0.5
The Innovative Form Builder – IvyForms v0.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / ContactFormTemplate.php

ContactFormTemplate.php in The Innovative Form Builder – IvyForms 0.5, at backend/src/Services/Template/ContactFormTemplate.php

110 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace IvyForms\Services\Template;
6
7 use IvyForms\Services\Translations\BackendStrings;
8
9 class ContactFormTemplate
10 {
11 /**
12 * Get the contact form template
13 *
14 * @return array<string, mixed>
15 */
16 public static function getTemplate(): array
17 {
18 return [
19 'id' => 'contact_form',
20 'name' => BackendStrings::getTemplateStrings()['contact_form'],
21 'description' => BackendStrings::getTemplateStrings()['contact_form_desc'],
22 'category' => 'basic',
23 'is_pro' => false,
24 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'contact-form.svg',
25 'form_data' => [
26 'name' => 'Contact Form',
27 'description' => 'Get in touch with us using this contact form',
28 'published' => 1,
29 'showTitle' => 1,
30 'storeEntries' => 1,
31 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
32 'fields' => [
33 [
34 'id' => 'first_name',
35 'fieldIndex' => 1,
36 'type' => 'text',
37 'label' => 'First Name',
38 'placeholder' => 'Enter your first name',
39 'required' => true,
40 'validation' => [
41 'required' => true,
42 ],
43 'settings' => [
44 'css_class' => 'ivyforms-field-first-name'
45 ]
46 ],
47 [
48 'id' => 'last_name',
49 'fieldIndex' => 2,
50 'type' => 'text',
51 'label' => 'Last Name',
52 'placeholder' => 'Enter your last name',
53 'required' => true,
54 'validation' => [
55 'required' => true,
56 ],
57 'settings' => [
58 'css_class' => 'ivyforms-field-last-name'
59 ]
60 ],
61 [
62 'id' => 'email',
63 'fieldIndex' => 3,
64 'type' => 'email',
65 'label' => 'Email Address',
66 'placeholder' => 'Enter your email address',
67 'required' => true,
68 'validation' => [
69 'required' => true,
70 'email' => true
71 ],
72 'settings' => [
73 'css_class' => 'ivyforms-field-email'
74 ]
75 ],
76 [
77 'id' => 'subject',
78 'fieldIndex' => 4,
79 'type' => 'text',
80 'label' => 'Subject',
81 'placeholder' => 'What is this regarding?',
82 'required' => false,
83 'validation' => [
84 'required' => false,
85 ],
86 'settings' => [
87 'css_class' => 'ivyforms-field-subject'
88 ]
89 ],
90 [
91 'id' => 'message',
92 'fieldIndex' => 5,
93 'type' => 'textarea',
94 'label' => 'Message',
95 'placeholder' => 'Please enter your message here...',
96 'required' => false,
97 'validation' => [
98 'required' => false,
99 ],
100 'settings' => [
101 'css_class' => 'ivyforms-field-message'
102 ]
103 ]
104 ],
105 'settings' => []
106 ]
107 ];
108 }
109 }
110