# Contact Form 7 Plugin

The Cost Calculator plugin is integrated with the Contact 7 plugin, and it is possible to use the custom contact form instead of the default one.

{% hint style="warning" %}
The **Contact Form 7** plugin should be installed before enabling the Contact Form option in Send Form settings. To download the Contact Form 7 plugin go here: [Download Contact Form](https://wordpress.org/plugins/contact-form-7/)&#x20;
{% endhint %}

### Creating a custom Contact form

To create a form, open **Contact > Contact Forms** on your WordPress dashboard. You can manage multiple forms from this location.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FJFQol6PzU9NvTBXMGuuE%2FCCB%20-%20Contact%207%20dashboard.png?alt=media&#x26;token=adcc647e-3c66-44bf-8e0c-8e6660ed16cf" alt=""><figcaption></figcaption></figure>

A contact form is already available for immediate use. Right next to the name Contact form 1, you can see the shortcode **\[contact-form-7 id="16" title="Contact form 1"].** By editing the contact form you can customize the contact form field.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FHb5voc95dYg1WKhRueFx%2FCCB%20-%20Contact%207%20edit.png?alt=media&#x26;token=74aecce1-b93b-4241-94a7-bdb89a66c0c5" alt=""><figcaption></figcaption></figure>

While editing the contact form, the tabs on top of the text area offer some useful tags for composing/customizing the email. The text area already has a basic collection of tags. However, you can insert any element by inserting the proper tag.

{% hint style="danger" %}
**Important!**

Please make sure that your form contains the **\[textarea]** field since the calculated data will be included in that field. The **\[textarea]** field is used to display the total summary generated by the Cost Calculator plugin. Without this field, the administrator and customers may receive empty emails.
{% endhint %}

After creating Contact form fields it is required to set up the Mail template. To do this switch to the Mial tab and fill out the fileds:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Ftn4pIReqWxFD3qONu8eE%2FCCB%20-%20Contact%207%20mail.png?alt=media&#x26;token=04f34008-d2e1-46e1-a244-30e7ce37aa73" alt=""><figcaption></figcaption></figure>

At this point, most of the customization for the form is complete. You can use this form in the Calculator settings.

{% hint style="success" %}
More details regarding contact form settings can be found in the [Contact 7 documentation](https://contactform7.com/docs/).
{% endhint %}

### Choosing the Contact 7 form in the Calculator settings

After enabling the integration of the Contact form 7 Plugin, the other options in this section will be different from your choice of form. The first option includes all your forms with the built-in Contact form 7 plugin with the Default form of the Cost Calculator plugin. You can use either the default form or your own Contact forms Contact Form 7 Plugin

![](https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FkKi3S5rtRDv0GP7QYdqu%2FCCBN%20contact%207%20ind%20new.png?alt=media\&token=06045a9e-967f-46ab-a873-9ac07b2053ba)

When you choose one of your Contact forms created in the Contact Form 7 plugin, you will see the generated text as ready email content. This text will be sent to the email that you set up in your chosen Contact Form 7 plugin.

### Contact Form Content

[Contact Form Content](#user-content-fn-1)[^1] displays the custom text and totals summary while submitting the form.

{% hint style="warning" %}
Contact Form Content will be displayed in the **\[textarea]** field, and if you have custom text in Contact Form 7, it will be overwritten.
{% endhint %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FRf0NkqU9V2zzW7CgMIXK%2Fimage.png?alt=media&#x26;token=1e7d210e-689c-4aaf-84ab-69a60448faf6" alt=""><figcaption><p>Individual Settings -> Order Form -> Contact Form Content</p></figcaption></figure>

Formula (Total) Fields and elements that have been used to build the calculator are displayed using the following shortcodes:

**\[ccb-subtotal]** - Displays the value of the fields that are used in the Cost calculator. Fields with a '0' value will not be added to the Contact Form.&#x20;

**\[ccb-total-0]** - Displays all formula fields with their value that have been selected in the **Total Field Element** setting in the **Order Form** section of the I**ndividual Settings** of the calculator.&#x20;

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FtYys32kVPVOoOGVsWh7r%2Fimage.png?alt=media&#x26;token=fde29a66-a70b-40ef-8470-91f38febdb3d" alt=""><figcaption><p>Total Field Element settings in the Individual Calculator Settings</p></figcaption></figure>

{% hint style="success" %}
So, it's totally up to the **Total Field Element** setting which formula field(s) will be added to the Contact Form.
{% endhint %}

### Example

Here is the example of Contact Form 1 which is created in the Contact Form 7 plugin.

![](https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FumK1r8jVaA39BIx8DPl1%2FCCBN%20contact%20form%207%20front.png?alt=media\&token=7fa6b57e-692b-46a3-bcf7-2966929b8641)

Now, let's see how it will appear in the calculator form after clicking the Submit button

![](https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FD5qbgAa45oVO7Vp6Q71D%2FCCBN%20contact%20form%207%20emty.png?alt=media\&token=cc0ea8b5-d39b-44eb-9550-1b0fee3aa348)

The result of the message of the Contact Form 7 Plugin sent to the admin of the website:

![](https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FRbURJtS7AfhyRgkdVC83%2FCCBN%20contact%20form%207%20inbox.png?alt=media\&token=5fcea23e-6852-4dc0-9592-993445c99553)

[^1]: Individual Settings -> Order Form -> Contact Form Content
