{"id":11520,"date":"2025-05-13T14:58:51","date_gmt":"2025-05-13T14:58:51","guid":{"rendered":"https:\/\/www.lemaiyansuites.com\/lost-password\/"},"modified":"2025-05-13T14:58:51","modified_gmt":"2025-05-13T14:58:51","slug":"lost-password","status":"publish","type":"page","link":"https:\/\/www.lemaiyansuites.com\/lost-password\/","title":{"rendered":"Lost Password"},"content":{"rendered":"\r\n<style>\r\n    .knsl-blog-post {\r\n        background-color: transparent !important;\r\n        padding: unset !important;\r\n        border-radius: unset !important;\r\n        -webkit-box-shadow: unset !important;\r\n        box-shadow: unset !important;\r\n    }\r\n<\/style>\r\n\r\n<div class=\"lemcrm-auth-container\">\r\n    <div class=\"lemcrm-auth-box\">\r\n                    <div class=\"lemcrm-auth-logo text-center mb-4\">\r\n                <img decoding=\"async\" class=\"img-fluid\"  src=\"https:\/\/www.lemaiyansuites.co.ke\/wp-content\/uploads\/2025\/05\/Lemaiyan-Suites-transparent_Small.png\" alt=\"Login\" style=\"height: 100px; margin: 0 auto; object-fit: cover;\">\r\n            <\/div>\r\n            \r\n            <form id=\"lemcrm-lost-password-form\" class=\"lemcrm-form\" method=\"post\">\r\n                <input type=\"hidden\" id=\"lemcrm_lost_password_nonce\" name=\"lemcrm_lost_password_nonce\" value=\"853dd66ba8\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/api\/wp\/v2\/pages\/11520\" \/>                \r\n                <div class=\"form-group\">\r\n                    <label for=\"user_login\">Username or Email *<\/label>\r\n                    <input type=\"text\" name=\"user_login\" id=\"user_login\" class=\"form-control\" required>\r\n                <\/div>\r\n\r\n                <div class=\"form-group\">\r\n                    <button type=\"submit\" class=\"knsl-btn knsl-btn-primary\">\r\n                        Reset Password                    <\/button>\r\n                <\/div>\r\n\r\n                <div class=\"form-links\">\r\n                    <a href=\"https:\/\/www.lemaiyansuites.com\/login\/\" class=\"login-link\">\r\n                        Back to Login                    <\/a>\r\n                <\/div>\r\n            <\/form>\r\n            <\/div>\r\n<\/div>\r\n\r\n<script>\r\njQuery(document).ready(function($) {\r\n    \/\/ Handle lost password form submission\r\n    $('#lemcrm-lost-password-form').on('submit', function(e) {\r\n        e.preventDefault();\r\n        \r\n        const form = $(this);\r\n        const submitButton = form.find('button[type=\"submit\"]');\r\n        const formData = new FormData(this);\r\n        \r\n        formData.append('action', 'lemcrm_lost_password');\r\n        \r\n        submitButton.prop('disabled', true);\r\n        \r\n        $.ajax({\r\n            url: lemcrmPublic.ajaxurl,\r\n            type: 'POST',\r\n            data: formData,\r\n            processData: false,\r\n            contentType: false,\r\n            success: function(response) {\r\n                if (response.success) {\r\n                    Swal.fire({\r\n                        icon: 'success',\r\n                        title: 'Email Sent',\r\n                        text: response.data.message,\r\n                        showConfirmButton: false,\r\n                        timer: 2000\r\n                    }).then(function() {\r\n                        window.location.href = response.data.redirect;\r\n                    });\r\n                } else {\r\n                    Swal.fire({\r\n                        icon: 'error',\r\n                        title: 'Error',\r\n                        text: response.data.message\r\n                    });\r\n                }\r\n            },\r\n            error: function() {\r\n                Swal.fire({\r\n                    icon: 'error',\r\n                    title: 'Error',\r\n                    text: 'An error occurred. Please try again.'\r\n                });\r\n            },\r\n            complete: function() {\r\n                submitButton.prop('disabled', false);\r\n            }\r\n        });\r\n    });\r\n\r\n    \/\/ Handle reset password form submission\r\n    $('#lemcrm-reset-password-form').on('submit', function(e) {\r\n        e.preventDefault();\r\n        \r\n        const form = $(this);\r\n        const submitButton = form.find('button[type=\"submit\"]');\r\n        const formData = new FormData(this);\r\n        \r\n        \/\/ Validate password match\r\n        if (formData.get('user_pass') !== formData.get('user_pass_confirm')) {\r\n            Swal.fire({\r\n                icon: 'error',\r\n                title: 'Password Mismatch',\r\n                text: 'Passwords do not match.'\r\n            });\r\n            return;\r\n        }\r\n        \r\n        formData.append('action', 'lemcrm_reset_password');\r\n        \r\n        submitButton.prop('disabled', true);\r\n        \r\n        $.ajax({\r\n            url: lemcrmPublic.ajaxurl,\r\n            type: 'POST',\r\n            data: formData,\r\n            processData: false,\r\n            contentType: false,\r\n            success: function(response) {\r\n                if (response.success) {\r\n                    Swal.fire({\r\n                        icon: 'success',\r\n                        title: 'Password Reset',\r\n                        text: response.data.message,\r\n                        showConfirmButton: false,\r\n                        timer: 2000\r\n                    }).then(function() {\r\n                        window.location.href = response.data.redirect;\r\n                    });\r\n                } else {\r\n                    Swal.fire({\r\n                        icon: 'error',\r\n                        title: 'Error',\r\n                        text: response.data.message\r\n                    });\r\n                }\r\n            },\r\n            error: function() {\r\n                Swal.fire({\r\n                    icon: 'error',\r\n                    title: 'Error',\r\n                    text: 'An error occurred. Please try again.'\r\n                });\r\n            },\r\n            complete: function() {\r\n                submitButton.prop('disabled', false);\r\n            }\r\n        });\r\n    });\r\n});\r\n<\/script> \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":0,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-fullwidth.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-11520","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/pages\/11520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/types\/page"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/comments?post=11520"}],"version-history":[{"count":0,"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/pages\/11520\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.lemaiyansuites.com\/api\/wp\/v2\/media?parent=11520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}