<commit_before><h2>Build and embed in articles forms</h2>

<h3>Intro</h3>
<p>BraDyCMS supports natively the creation of custom forms and their embedding in articles.</p>
<p>There is a specific admin plugin to handle the creation and the management of custom forms. The plugin is located in the main menu: <code>{{ tr.get('plugins') }}</code> > <code>{{ tr.get('user_forms') }}</code>.</p>

<h3>Create a new custom form</h3>
<p>To create a new custom form just click the <code>{{ tr.get('add_new_form') }}</code> button and enter a form id.</p>
<p class="text-danger">Pay attention: form ids must be unique. If you enter the name of a previously existing form the former will be deleted and <strong>overwritten</strong>!</p>


<h3>Embed a form in article's body</h3>
<p>Embedding a form in an article's body is very simple. Just use the custom tag <code>[[userform]]</code> with the name/id of your form.</p>
<p>For example, to ambed the form named <code>contactus</code> in an article's body just add this simple tag:</p>
<pre>[[userform]]contactus[[/userform]]</pre>.
<p>BraDyCMS will do the rest: form formatting, validation and email & attach delivery.</p>


<h3>Custom form syntax</h3>
<p>The configuration of a user form must follow a simple but rigid syntax. The configuration file must be a valid <a href="http://www.json.org/" target="_blank">json file</a>. BraDyCMS integrates a real-time validator to help finding any syntax error.</p>
		


<h4>General data</h4>
<table class="table table-bordered table-striped">
	<tr>
		<th>Parameter</th>
		<th>Type</th>
		<th>Required/optional</th>
		<th>Description</th>
	</tr>

	<tr>
		<th>to</th>
		<td>string</td>
		<td>required</td>
		<td>A valid email address</td>
	</tr>

	<tr>
		<th>from_email</th>
		<td>string</td>
		<td>required</td>
		<td>Valid email address</td>
	</tr>

	<tr>
		<th>from_name</th>
		<td>string</td>
		<td>optional</td>
		<td>Name for the from_email address</td>
	</tr>

	<tr>
		<th>subject</th>
		<td>string</td>
		<td>required</td>
		<td>Email message subject</td>
	</tr>

	<tr>
		<th>success_text</th>
		<td>string</td>
		<td>required</td>
		<td>Message to display when email is successfully sent</td>
	</tr>

	<tr>
		<th>error_text</th>
		<td>string</td>
		<td>required</td>
		<td>Message to display when email is NOT successfully sent</td>
	</tr>
	<commit_msg>Userform docs updated<commit_after><h2>Build and embed in articles forms</h2>

<h3>Intro</h3>
<p>BraDyCMS supports natively the creation of custom forms and their embedding in articles.</p>
<p>There is a specific admin plugin to handle the creation and the management of custom forms. The plugin is located in the main menu: <code>{{ tr.get('plugins') }}</code> > <code>{{ tr.get('user_forms') }}</code>.</p>

<h3>Create a new custom form</h3>
<p>To create a new custom form just click the <code>{{ tr.get('add_new_form') }}</code> button and enter a form id.</p>
<p class="bg-danger">Pay attention: form ids must be unique. If you enter the name of a previously existing form the former will be deleted and <strong>overwritten</strong>!</p>


<h3>Embed a form in article's body</h3>
<p>Embedding a form in an article's body is very simple. Just use the custom tag <code>[[userform]]</code> with the name/id of your form.</p>
<p>For example, to embed the form named <code>contactus</code> in an article's body just add this simple tag:</p>
<pre>[[userform]]contactus[[/userform]]</pre>
<p>You can aso provide a subject directly in the form definition, overwrting the custom one defined in the configuration file (see below):</p>
<pre>[[userform subject="Contact us"]]contactus[[/userform]]</pre>
<p>BraDyCMS will do the rest: form formatting, validation and email & attach delivery.</p>



<h3>Custom form syntax</h3>
<p>The configuration of a user form must follow a simple but rigid syntax. The configuration file must be a valid <a href="http://www.json.org/" target="_blank">json file</a>. BraDyCMS integrates a real-time validator to help finding any syntax error.</p>
		


<h4>General data</h4>
<table class="table table-bordered table-striped">
	<tr>
		<th>Parameter</th>
		<th>Type</th>
		<th>Required/optional</th>
		<th>Description</th>
	</tr>

	<tr>
		<th>to</th>
		<td>string</td>
		<td>required</td>
		<td>A valid email address</td>
	</tr>

	<tr>
		<th>from_email</th>
		<td>string</td>
		<td>required</td>
		<td>Valid email address</td>
	</tr>

	<tr>
		<th>from_name</th>
		<td>string</td>
		<td>optional</td>
		<td>Name for the from_email address</td>
	</tr>

	<tr>
		<th>subject</th>
		<td>string</td>
		<td>required</td>
		<td>Email message subject. This setting can be overwritten in the article content of template file where the form is rendered.</td>
	</tr>

	<tr>
		<th>success_text</th>
		<td>string</td>
		<td>required</td>
		<td>Message to display when email is successfully sent</td>
	</tr>

	<tr>
		<th>error_text</th>
		<td>string</td>
		<td>required</td>
		<td>Message to display when email is NOT successfully sent</td>
	</tr>
	
{'fraction_non_alphanumeric': 0.15663132626525306, 'fraction_numerical': 0.004800960192038408, 'mean_word_length': 4.353319057815845, 'pattern_counts': {'":': 0, '<': 237, '<?xml version=': 0, '>': 239, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2952520', 'n_tokens_mistral': 1842, 'n_tokens_neox': 1728, 'n_words': 580}