| Server IP : 104.26.3.156 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/themastermynd/public_html/wp-content/plugins/optinmonster/assets/js/ |
Upload File : |
/* ==========================================================
* mailpoet.js
* ==========================================================
* Copyright 2022 Awesome Motive.
* https://awesomemotive.com
* ========================================================== */
jQuery(document).ready(function ($) {
// Default Campaigns
document.addEventListener('om.Optin.init.submit', function (event) {
var campaign = event.detail.Campaign;
var optin = event.detail.Optin;
$.each(omapi_localized.slugs, function (i, v) {
if (!v.mailpoet) {
return;
}
if (i !== campaign.id) {
return;
}
// Send a request to force optin to work even if no provider is set.
var data = optin.data;
data.optin = campaign.id;
if (data.fields) {
$.extend(data, data.fields);
}
// Post to MailPoet.
postToMailPoet(data);
return false;
});
});
/**
* Unbind events when the campaign selector is unmounted.
*
* @param {object} data Data object containing the campaign slug and target document.
*
* @returns {void}
*/
function postToMailPoet(data) {
// Now make an ajax request to make the optin locally.
$.post(
omapi_localized.ajax,
{
action: 'mailpoet',
nonce: omapi_localized.nonce,
no_provider: true,
optinData: data,
},
function () {},
'json'
);
}
});