function SendRegistrationForm(el){
    event.preventDefault()
    let form = el.form;
    let formData = new FormData(form);
    let msr = sessionStorage.getItem('mailingSubscribeRequired')
    formData.set('mailingSubscribeRequired',msr)

    $.ajax({
        headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
        url: '/user_account/registration/',
        type: "POST",
        // async: true,
        cache: false,
        processData: false,
        contentType: false,
        // enctype: 'json',
        data: formData,
        success: function(data){
            document.querySelector('.info_text').classList.add('show')
            // location.href = `/profile/page/dashboard/`
            window.sessionStorage.removeItem('mailingSubscribeRequired')
            window.sessionStorage.removeItem('email')


            if(typeof ym === 'function'){
                ym(97070898,'reachGoal','Registration')
                return true;
            }else {
              console.log('Скрипт Яндекс.Метрики не найден. Статистика не будет отправлена.');
            }


        },
        error: function (data, exception){
            document.querySelector(".register").innerHTML = data.responseJSON.html
        }
    });
}


