Skip to content

Commit

Permalink
Add more descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Sep 27, 2020
1 parent 2cf5484 commit 22a8772
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Form/Type/FormActionSaveField.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'field',
LeadFieldsType::class,
[
'label' => 'mautic.form.field.section.leadfield',
'label' => 'mautic.formactions.contact.field.to.save',
'label_attr' => ['class' => 'control-label'],
'multiple' => false,
'with_company_fields' => false,
Expand All @@ -58,6 +58,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label_attr' => ['class' => 'control-label'],
'attr' => [
'class' => 'form-control',
'tooltip' => 'mautic.formactions.syntax.desc'
],
'required' => true,
'constraints' => [
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ Plugin allow save to any fields custom string processign by twig syntax from for

Another example of twig syntax

`{{formfield.firstname}}x{{formfield.email|slice(0, 4)}}`
- `{{formfield.email|slice(0, 4)}}` - four letters from email
- `{{ formfield.email|split('@')|last }}` - domain of provider from email address - string after @
- `{{ formfield.email|split('@')|first }}` - string before @ from email address

Of course, you are able to process data with any twig feature, you can truncate data etc.
Of course, you are able to process data with any twig feature, you are able to transform/truncate data etc.

#### Allowed tags in syntax

- {{ formfield.alias }} - any field from submitted form
- {{ contactfield.alias }} - any contact fields

## Installation

Expand All @@ -18,10 +25,10 @@ Of course, you are able to process data with any twig feature, you can truncate
2. Unzip files to plugins/MauticFormActionsBundle
3. Clear cache (app/cache/prod/)
4. Go to /s/plugins/reload
5. Enable Form Actions
6. Go to forms, create form and see new Form Save actions option in actions tab

### Usage

{{formfield.firstname}} {{formfield.email|slice(0, 4)}}
<img src="https://user-images.githubusercontent.com/462477/94358620-b0739980-00a2-11eb-9bf1-07af4518967a.png" width="500">

### Credits

Expand Down
3 changes: 2 additions & 1 deletion Translations/en_US/messages.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ mautic.formactions.save_field="Form Save Actions"
mautic.formactions.save_field.desc="Acctions allow process form fields and contact fields after save form"
mautic.formactions.syntax="Twig Syntax"
mautic.formactions.syntax.desc="Allowd tags: {{ formfield.alias }} and {{ contactfield.alias }}"
mautic.formactions.overwriteWithBlank="Overwrite with blank"
mautic.formactions.overwriteWithBlank="Overwrite with blank"
mautic.formactions.contact.field.to.save="Contact field to save processed data"

0 comments on commit 22a8772

Please sign in to comment.