b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / app / code / Mageplaza / Smtp / view / adminhtml / web / js /
Filename/home/dev2.destoffenstraat.com/app/code/Mageplaza/Smtp/view/adminhtml/web/js/abandonedcart.js
Size4.48 kb
Permissionrwxrwxrwx
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified02-Nov-2021 12:47
Last accessed22-Aug-2025 21:37
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_SMTP
* @copyright Copyright (c) Mageplaza (http://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
define([
'jquery',
'Magento_Ui/js/modal/modal'
], function ($, modal) {
"use strict";

$.widget('mageplaza.abandonedcarts', {

_create: function () {
this.initObserve();
},

/**
* Init observe
*/
initObserve: function () {
var self = this,
popupSendEmailElement = $('#popup-send-email'),
copyElement = $('#copy');

$("#send").click(function () {
$('#popup-send-email-details').show();
$('#popup-send-email-preview').show();
$('#preview').hide();
$('#popup-send-email-back').hide();

modal({
type: 'popup',
responsive: true,
innerScroll: true,
title: '',
buttons: []
}, popupSendEmailElement);

popupSendEmailElement.modal('openModal');
});

$('#popup-send-email-preview').click(function () {
self.preview();
});

$('#popup-send-email form').submit(function(){
$(this).find(':submit').attr('disabled','disabled');
});


$('#popup-send-email-back').click(function () {
$('#popup-send-email-details').show();
$('#popup-send-email-preview').show();
$('#preview').hide();
this.hide();
});

copyElement.click(function () {
self.copyToClipboard();
$('#link-tooltip').text(self.options.copied_message);

});

copyElement.mouseout(function () {
$('#link-tooltip').text(self.options.tooltip);
})

},
copyToClipboard: function(){
var temp = $('<input>');

$('body').append(temp);
temp.val($('#recovery_link > span').text()).select();
document.execCommand('copy');
temp.remove();
},

/**
* @param type
* @param message
* @returns {string}
*/
getMessageHtml: function (type, message) {
return '<div class="message message-' + type + '"> <span>' + message + '</span> </div>';
},
getParams: function () {
return {
from: $('#sender').val(),
quote_id: this.options.quote_id,
template_id: $('#email-template').val(),
customer_name: this.options.customer_name,
additional_message: $('#additional-message').val()
}
},
preview: function () {
var self = this;

$.ajax({
url: this.options.preview_url,
data: this.getParams(),
dataType: 'json',
showLoader: true,
success: function (result) {
if (result.status) {
var dstFrame = document.getElementById('iframe-preview'),
dstDoc = dstFrame.contentDocument || dstFrame.contentWindow.document;

dstDoc.write(result.content);
dstDoc.close();
$('#popup-send-email-details').hide();
$('#popup-send-email-back').show();
$('#preview').show();
$('#popup-send-email-preview').hide();
$('#subject strong').text(result.subject);
$('#preview-from').text(result.from.email);
} else {
$('#popup-send-email #messages').html(self.getMessageHtml('error error', result.message));
}
}
});
}
});

return $.mageplaza.abandonedcarts;
});