{"id":176,"date":"2024-08-08T13:26:35","date_gmt":"2024-08-08T13:26:35","guid":{"rendered":"https:\/\/monichron.co.za\/monichron\/?page_id=176"},"modified":"2024-08-16T08:42:55","modified_gmt":"2024-08-16T08:42:55","slug":"mailer","status":"publish","type":"page","link":"https:\/\/monichron.co.za\/index.php\/mailer\/","title":{"rendered":"Mailer Test"},"content":{"rendered":"    <style>\r\n        #request-form {\r\n            background-color: #ff0000; \/* Red background *\/\r\n            padding: 20px;\r\n            border-radius: 5px;\r\n            width: 300px;\r\n            margin: 0 auto;\r\n        }\r\n        #request-form input, #request-form button {\r\n            display: block;\r\n            width: 100%;\r\n            margin-bottom: 10px;\r\n            padding: 10px;\r\n            border: none;\r\n            border-radius: 5px;\r\n        }\r\n        #request-form input {\r\n            background-color: #fff; \/* White background for inputs *\/\r\n            color: #000; \/* Black text for inputs *\/\r\n        }\r\n        #request-form button {\r\n            background-color: #d9534f; \/* Red button *\/\r\n            color: #fff; \/* White text for button *\/\r\n            cursor: pointer;\r\n        }\r\n        #request-form button:hover {\r\n            background-color: #c9302c; \/* Darker red on hover *\/\r\n        }\r\n        #response {\r\n            margin-top: 10px;\r\n        }\r\n    <\/style>\r\n    <form id=\"request-form\">\r\n        <input type=\"text\" id=\"email-input\" placeholder=\"Email\" \/>\r\n        <input type=\"text\" id=\"body-input\" placeholder=\"Body\" \/>\r\n        <button type=\"button\" id=\"send-request-btn\">Send Request<\/button>\r\n        <div id=\"response\"><\/div>\r\n    <\/form>\r\n    <script type=\"text\/javascript\"> \r\n        document.addEventListener('DOMContentLoaded', function() {\r\n            document.getElementById('send-request-btn').addEventListener('click', function() {\r\n                var email = document.getElementById('email-input').value;\r\n                var body = document.getElementById('body-input').value;\r\n                var xhr = new XMLHttpRequest();\r\n                xhr.open('POST', 'https:\/\/monichron.co.za\/wp-admin\/admin-ajax.php', true);\r\n                xhr.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded');\r\n                xhr.onload = function() {\r\n                    if (xhr.status === 200) {\r\n                        document.getElementById('response').innerText = xhr.responseText;\r\n                    } else {\r\n                        document.getElementById('response').innerText = 'Request failed.';\r\n                    }\r\n                };\r\n                xhr.send('action=send_request&email=' + encodeURIComponent(email) + '&body=' + encodeURIComponent(body));\r\n            });\r\n        });\r\n    <\/script>\r\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_gspb_post_css":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"class_list":["post-176","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/pages\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":14,"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/pages\/176\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/pages\/176\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/monichron.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}