# ivyforms/0.5/backend/src/Services/Template/ContactFormTemplate.php

The Innovative Form Builder – IvyForms, version 0.5. 110 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/0.5/code/backend/src/Services/Template/ContactFormTemplate.php
- Raw: https://pluginprobe.com/plugins/ivyforms/0.5/raw/backend/src/Services/Template/ContactFormTemplate.php
- Modified: 2025-10-23T15:35:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ivyforms/0.5/code/backend/src/Services/Template/ContactFormTemplate.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace IvyForms\Services\Template;

use IvyForms\Services\Translations\BackendStrings;

class ContactFormTemplate
{
    /**
     * Get the contact form template
     *
     * @return array<string, mixed>
     */
    public static function getTemplate(): array
    {
        return [
            'id' => 'contact_form',
            'name' => BackendStrings::getTemplateStrings()['contact_form'],
            'description' => BackendStrings::getTemplateStrings()['contact_form_desc'],
            'category' => 'basic',
            'is_pro' => false,
            'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'contact-form.svg',
            'form_data' => [
                'name' => 'Contact Form',
                'description' => 'Get in touch with us using this contact form',
                'published'     => 1,
                'showTitle'     => 1,
                'storeEntries'  => 1,
                'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
                'fields' => [
                    [
                        'id' => 'first_name',
                        'fieldIndex' => 1,
                        'type' => 'text',
                        'label' => 'First Name',
                        'placeholder' => 'Enter your first name',
                        'required' => true,
                        'validation' => [
                            'required' => true,
                        ],
                        'settings' => [
                            'css_class' => 'ivyforms-field-first-name'
                        ]
                    ],
                    [
                        'id' => 'last_name',
                        'fieldIndex' => 2,
                        'type' => 'text',
                        'label' => 'Last Name',
                        'placeholder' => 'Enter your last name',
                        'required' => true,
                        'validation' => [
                            'required' => true,
                        ],
                        'settings' => [
                            'css_class' => 'ivyforms-field-last-name'
                        ]
                    ],
                    [
                        'id' => 'email',
                        'fieldIndex' => 3,
                        'type' => 'email',
                        'label' => 'Email Address',
                        'placeholder' => 'Enter your email address',
                        'required' => true,
                        'validation' => [
                            'required' => true,
                            'email' => true
                        ],
                        'settings' => [
                            'css_class' => 'ivyforms-field-email'
                        ]
                    ],
                    [
                        'id' => 'subject',
                        'fieldIndex' => 4,
                        'type' => 'text',
                        'label' => 'Subject',
                        'placeholder' => 'What is this regarding?',
                        'required' => false,
                        'validation' => [
                            'required' => false,
                        ],
                        'settings' => [
                            'css_class' => 'ivyforms-field-subject'
                        ]
                    ],
                    [
                        'id' => 'message',
                        'fieldIndex' => 5,
                        'type' => 'textarea',
                        'label' => 'Message',
                        'placeholder' => 'Please enter your message here...',
                        'required' => false,
                        'validation' => [
                            'required' => false,
                        ],
                        'settings' => [
                            'css_class' => 'ivyforms-field-message'
                        ]
                    ]
                ],
                'settings' => []
            ]
        ];
    }
}

```
