K
K
kolykisel2018-09-30 15:34:53
MODX
kolykisel, 2018-09-30 15:34:53

Forms do not work on the English version of the site, what's the problem?

Hello, please tell me what could be the problem? Here there is a Russian version of the site balt-montage.ru/, and there is an English version balt-montage.ru/en/, on the Russian version both forms work as they should, but on the English version messages do not arrive (but a notification appears that the letter has been sent), although everything is done as in Russian, I throw off all the code associated with the English version of the form, can you tell me something, here is one of the forms:
Submission form via formit and ajaxform:

<div id="ask-question" class="fancybox-hidden">
      {if $_modx->context.key == 'en'}
        {var $question_formit_form = '@FILE chunks/callback/question/en/form.tpl'}
        {var $question_formit_mail = '@FILE chunks/callback/question/en/mail.tpl'}
        {var $question_formit_error = 'Please fill in all required fields'}
        {var $question_formit_success = 'Message sent successfully'}
      {else}
        {var $question_formit_form = '@FILE chunks/callback/question/ru/form.tpl'}
        {var $question_formit_mail = '@FILE chunks/callback/question/ru/mail.tpl'}
        {var $question_formit_error = 'Пожалуйста, заполните все требуемые поля'}
        {var $question_formit_success = 'Сообщение успешно отправлено'}
      {/if}
      {$_modx->runSnippet('!AjaxForm', [
        'snippet' => 'FormIt',
        'emailSubject' => 'Вопрос с сайта BALT MONTAGE',
        'emailTo' => $_modx->config.contacts_mail,
        'emailFrom' => $_modx->config.contacts_mail,
        'hooks' => 'recaptchav2,FormItSaveForm,email',
        'form' => $question_formit_form,
        'emailTpl' => $question_formit_mail,
        'validate' => 'name,email:required,phone:required,comment:required,g-recaptcha-response:required',
        'validationErrorMessage' => $question_formit_error,
        'successMessage' => $question_formit_success,
        'frontend_css' => ''
      ])}
      
    </div>

The form itself:
<div class="inner-content">
  <h1>Ask your question</h1>
  <p>Leave accurate information so that our manager can send you the answer or call on the phone!</p>
  <p><span style="color:#900;"></span></p>

  <form class="b-form big-inputs" id="callback-form" method="post" action="">
    <label for="name">Your name</label>
    <input type="text" name="name"  class="grid_3" value="{$_pls['fi.name']}">

    <label for="email">Your E-mail</label>
    <input type="text" name="email" class="grid_3" value="{$_pls['fi.email']}">

    <label for="subject">Your phone</label>
    <input type="text" name="phone" class="grid_3" value="{$_pls['fi.phone']}">

    <textarea name="comment" class="grid_6" cols="50" rows="10">{$_pls['fi.comment']}</textarea>
    
    <button class="btn-pink-bigger btn-pink-icon btn-margin" name="submit" type="submit">Send message</button>
  </form>
</div>

What comes to my mail:
<p><b>Имя</b>: {$name}</p>
<p><b>Номер телефона:</b> {$phone}</p>
<p><b>E-mail</b>: {$email}</p>
<p><br></p>
<p><b>Сообщение:</b> {$comment}</p>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question