Modx formit + fromz duplicate email

483 views Asked by At

I use the last modx revo with formZ and it duplicates emails. Each time I submit the form I receive the email twice. I can't figure it out. Here is my form tpl:

[[!FormIt?
    &hooks=`[[+action]][[+hooks:notempty=`,[[+hooks]]`]]`
    &excludeFields=`submit[[+id]]`
    &submitVar=`submit[[+id]]`
    &formid=`[[+id]]` [[- "Form ID"]]
    &store=`0`
    &storeTime=`900`
    &successMessage=`<p>[[+success_message]]</p>`
    &emailTo=`[[+email:default=``]]`
    [[+properties]]
    [[+validation:notempty=`&validate=`[[+validation]]``]]
    [[+validationText:notempty=`[[+validationText]]`]]
]]

[[!+fi.successMessage]]
[[!+fi.validation_error_message]]

<form class="form [[+identifier]]" action="" method="post">
    <fieldset>
        [[+fields]] 
    </fieldset>

    <div class="actions">
        <input type="submit" name="submit[[+id]]" value="[[+action_button:default=`Envoyer`]]" class="btn primary" />
    </div>
</form>

How to avoid duplicating emails? Any ideas?

1

There are 1 answers

1
Lucas Venturini On

Do you use multiple forms on the same page? Or maybe you use conditional calls? Something like: [[*someTV:is='12':then='[[!fomz]]':else='']]

(Note that the '' should be ``! Just can't use them here.) If so, have a gander at this.

It helped me, although I used [[If]] and made only one call. Basically I used the [[*formzTV]] call as it is and voilĂ . One mail, just as it should be.