Jump to content

Mailalert - verification of e-mail


Recommended Posts

In my form always is Request notification registered:

function  addNotification() {
    $.ajax({
        type: 'POST',
        url: "{/literal}{$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])}{literal}",
        data: 'id_product={/literal}{$id_product}{literal}&id_product_attribute='+$('#idCombination').val()+'&customer_email='+$('#oos_customer_email').val()+'',
        success: function (msg) {
            if ($.trim(msg) == '1') {
                $('#mailalert_link').hide();
                $('#oos_customer_email').hide();
                $('#oosHook').find('#gdpr_consent').hide();
                $('#oos_customer_email_result').html("{/literal}{l s='Request notification registered' mod='mailalerts'}{literal}");
                $('#oos_customer_email_result').css('color', 'green').show();
            }
            else if ($.trim(msg) == '2' ) {
                $('#oos_customer_email_result').html("{/literal}{l s='You already have an alert for this product' mod='mailalerts'}{literal}");
                $('#oos_customer_email_result').css('color', 'red').show();
            } else {
                $('#oos_customer_email_result').html("{/literal}{l s='Your e-mail address is invalid' mod='mailalerts'}{literal}");
                $('#oos_customer_email_result').css('color', 'red').show();
            }
        }
    });
    return false;
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...