Hi all.
It would be great to stick to the FormIt/AjaxForm integration as sponsored here:
https://itchief.ru/lessons/modx-revo/modx-contact-form (it's in russian but a google translation is enough to get to the point).
I have been following all the tutorial bits i found but i still can not make it work.
Here is my snippet call:
[[!AjaxForm?
&snippet=`FormIt`
&form=`tplAjaxForm`
&hooks=`FormItSaveForm,email`
&emailSubject=`New Contact`
&emailFrom=`[[+email]]`
&emailTo=`[email protected]`
&emailTpl=`emailTpl`
&validate=`name:required,email:email:required`
&validationErrorMessage=`Please correct the following errors:[[+errors]]`
&successMessage=`Cool, thanks`
]]
And here is the form or tplAjaxForm chunk:
<form id="contact-form" action="" method="post" class="ajax_form">
<div class="form-group"><!-- Name -->
<label for="name" class="contact-label">
[[%af_label_name]] [[+fi.error.name]]
</label>
<input type="text" id="af_name" name="name" class="form-control" placeholder="" value="[[+fi.name]]" />
</div>
<div class="form-group"><!-- Email -->
<label for="email" class="contact-label">
[[%af_label_email]] [[+fi.error.email]]
</label>
<input type="email" id="af_email" name="email" class="form-control" placeholder="" value="[[+fi.email]]" />
</div>
<div class="form-group">
<div class="form-group-margin">
<input type="submit" class="btn-submit" value="[[%af_submit]]" />
</div>
</div>
[[+fi.success:is=`1`:then=`
<div class="alert alert-success">[[+fi.successMessage]]</div>
`]]
[[+fi.validation_error:is=`1`:then=`
<div class="alert alert-danger">[[+fi.validation_error_message]]</div>
`]]
</form>
According to the documentation it is supposed to work.
But it doesn't.
Does anyone has succeeded in sending emails using ONLY the FormIt/AjaxForm combination?
It should be great to know.
[ed. note: fredela last edited this post 7 years, 2 months ago.]