Produktbewertungs-E-Mail

Wird geladen

Lorem ipsum dolor sit amet, consectetur idesiu. Fusce id purus eu elit mattis congue nec id Tortor.

* Email
* Name
* Titel der Rezension
* Schreiben Sie Ihre Bewertung unten
    Es gibt Belohnungen für das Hochladen von Bildern

    Message!

    ` $('body').append(notification_html); $('.message .close').on('click', function() { $(this).closest('.message').transition('fade'); }); if (window.SuperDisplayConfig) { var sdsConfig = window.SuperDisplayConfig; // console.log(sdsConfig, sdsConfig.settings.is_show_submit_title) if (sdsConfig) { $('.super-translate-email').html(sdsConfig.translate.your_email) $('.super-translate-name').html(sdsConfig.translate.your_name) $('.super-translate-title').html(sdsConfig.translate.your_title) $('.super-translate-review').html(sdsConfig.translate.your_feedback); if (sdsConfig.settings.is_show_submit_title == '0') { $('.TitleofReview').hide(); } } } //Get product information data var ssid = getUrlQueryString('ssid') var et_id = getUrlQueryString('et_id') var logs_id = getUrlQueryString('logs_id') var order_name = getUrlQueryString('order_name') var product_id = getUrlQueryString('product_id') var user_name = '' var user_email = '' console.log(ssid, product_id); $('.super-email-load-wrap').show(); var orderPdtObj = { spid: ssid, order_name: order_name, product_id: product_id, reviewer_email: '' }; $.ajax({ type: "POST", contentType: "application/json;charset=UTF-8", url: "https://dr.supersds.com/user/order_product", data: JSON.stringify(orderPdtObj), success: function(result) { result = JSON.parse(result); // console.log(result); if (result.status == 'success') { $('.super-email-load-wrap').hide(); $('.reviewEmailPdtImg').attr('src', result.data.product_images); $('.reviewEmailPdtName').html(result.data.product_name); $('.sdsReviewEmail').val(result.data.user_email); $('.sdsReviewName').val(result.data.user_name); user_name = result.data.user_name user_email = result.data.user_email } }, error: function(e) { console.log(e); // console.log(e.responseText); $('.super-email-load-wrap').hide(); }, complete(XMLHttpRequest, status) { // Request completed (regardless of success or failure) $('.super-email-load-wrap').hide(); if (status == 'timeout') { // console.log('timeout'); } } }); //Get variable configuration information data $.ajax({ type: "GET", contentType: "application/json;charset=UTF-8", url: "https://dr.supersds.com/user/shopify_page", data: { et_id: et_id, logs_id: logs_id }, success: function(result) { result = JSON.parse(result); // console.log(result); localStorage.setItem('reviewVarData', JSON.stringify(result)); if (result.status == 'success') { var logs_list = result.data.logs_list var email_template_list = result.data.email_template_list // console.log(email_template_list) // console.log(logs_list) if (email_template_list.length == 0) { // console.log('There is a problem with the data format, stop executing the following code'); return false } var email_subject = email_template_list.email_subject var message_body = email_template_list.message_body var email_footer = email_template_list.email_footer // $('.submit-reviews-wrap button').css({ // color: email_template_list.button_color // }) // $('.submit-reviews-wrap button').html(email_template_list.button_title) $('.email-logo-wrap img').attr('src', email_template_list.shop_logo_url) $('.email_banner img').attr('src', email_template_list.email_banner) email_subject = email_subject.replace(/{{customer.city}}/g, logs_list.customer_city); email_subject = email_subject.replace(/{{customer.country}}/g, logs_list.customer_country); email_subject = email_subject.replace(/{{customer.email}}/g, logs_list.customer_email); email_subject = email_subject.replace(/{{customer.first_name}}/g, logs_list.customer_first_name); email_subject = email_subject.replace(/{{customer.full_name}}/g, logs_list.customer_full_name); email_subject = email_subject.replace(/{{customer.last_name}}/g, logs_list.customer_last_name); email_subject = email_subject.replace(/{{customer.state}}/g, logs_list.customer_state); email_subject = email_subject.replace(/{{shop.name}}/g, logs_list.shop_name); email_subject = email_subject.replace(/{{shop.url}}/g, logs_list.shop_url); $('.email-subject-wrap').html(email_subject); message_body = message_body.replace(/{{customer.city}}/g, logs_list.customer_city); message_body = message_body.replace(/{{customer.country}}/g, logs_list.customer_country); message_body = message_body.replace(/{{customer.email}}/g, logs_list.customer_email); message_body = message_body.replace(/{{customer.first_name}}/g, logs_list.customer_first_name); message_body = message_body.replace(/{{customer.full_name}}/g, logs_list.customer_full_name); message_body = message_body.replace(/{{customer.last_name}}/g, logs_list.customer_last_name); message_body = message_body.replace(/{{customer.state}}/g, logs_list.customer_state); message_body = message_body.replace(/{{shop.name}}/g, logs_list.shop_name); message_body = message_body.replace(/{{shop.url}}/g, logs_list.shop_url); $('.message_body').html(message_body); email_footer = email_footer.replace(/{{customer.city}}/g, logs_list.customer_city); email_footer = email_footer.replace(/{{customer.country}}/g, logs_list.customer_country); email_footer = email_footer.replace(/{{customer.email}}/g, logs_list.customer_email); email_footer = email_footer.replace(/{{customer.first_name}}/g, logs_list.customer_first_name); email_footer = email_footer.replace(/{{customer.full_name}}/g, logs_list.customer_full_name); email_footer = email_footer.replace(/{{customer.last_name}}/g, logs_list.customer_last_name); email_footer = email_footer.replace(/{{customer.state}}/g, logs_list.customer_state); email_footer = email_footer.replace(/{{shop.name}}/g, logs_list.shop_name); email_footer = email_footer.replace(/{{shop.url}}/g, logs_list.shop_url); email_footer = email_footer.replace(/{{tools.unsubscribe}}/g, logs_list.unsubscribe); email_footer = email_footer.replace(/{{unsubscribe}}/g, 'Unsubscribe'); $('.email_footer').html(email_footer); var email_share_type = email_template_list.email_share_type // console.log(email_share_type) let email_share_html = `` let share_type_html = `` email_share_type.forEach((item, index, arr) => { if (item === '1') { share_type_html =`

    ` } else if (item === '2') { share_type_html =`

    ` } else if (item === '3') { share_type_html =`

    ` } share_type_html = share_type_html.replace('{{face_book_email_share}}', email_template_list.face_book_email_share) share_type_html = share_type_html.replace('{{twitter_email_share}}', email_template_list.twitter_email_share) share_type_html = share_type_html.replace('{{pinterest_email_share}}', email_template_list.pinterest_email_share) email_share_html += share_type_html }) // console.log(email_share_html) $('.footer-share-icon-wrap').html(email_share_html); } }, error: function(e) { console.log(e); // console.log(e.responseText); }, complete(XMLHttpRequest, status) { // Request completed (regardless of success or failure) if (status == 'timeout') { //超时的回调 // console.log('timeout'); } } }); // Set star rating var rating = 5 $(document).on("click", ".rating-stars-container .rating-star", function() { var elementIndex = $(this).index(); rating = elementIndex + 1 console.log(rating) $('.rating-star').removeClass('is--active'); $('#product-rating-value').val(elementIndex + 1) var i = 0; $.each($('.rating-stars-container').children('.rating-star'), function(index, element) { // console.log($(element)) if (i { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); return false; } } } else { if (title == '' || title == undefined) { $('.super-email-notification-wrap .super-email-notification-title').html(sdsConfig.translate.your_title); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); return false; } } if (body == '') { $('.super-email-notification-wrap .super-email-notification-title').html(sdsConfig.translate.your_feedback_notice); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); $('.super-email-notification-wrap'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); return false; } $('.super-email-load-wrap').show(); var list = {} // $('.sds-button-loading').show(); if (updateImgArr.length > 0) { list = { spid: ssid, order_id: order_name, product_id: product_id, product_handle: producthanle, rating: rating, title: $('.sdsReviewTitle').val(), body: $('.sdsReviewEmailBody').val(), reviewer_name: $('.sdsReviewName').val(), reviewer_email: $('.sdsReviewEmail').val(), default_image: updateImgArr[0] !== undefined ? updateImgArr[0] : '', picture_urls1: updateImgArr[0] !== undefined ? updateImgArr[0] : '', picture_urls2: updateImgArr[1] !== undefined ? updateImgArr[1] : '', picture_urls3: updateImgArr[2] !== undefined ? updateImgArr[2] : '', picture_urls4: updateImgArr[3] !== undefined ? updateImgArr[3] : '', picture_urls5: updateImgArr[4] !== undefined ? updateImgArr[4] : '', }; console.log(list); $.ajax({ type: "POST", contentType: "application/json;charset=UTF-8", url: "https://dr.supersds.com/user/push_img_review", data: JSON.stringify(list), success: function(result) { // console.log(result); var resultData = JSON.parse(result); console.log(resultData); $('.super-email-load-wrap').hide(); $('.super-email-notification-wrap .super-email-notification-title').html(resultData.message); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); if (resultData.status == 'success') { localStorage.setItem('reviewPostSuccess', JSON.stringify(resultData)); setTimeout(() => { // window.open('thank-you-review'); window.open('thank-you-review', '_self'); }, 500); } }, error: function(e) { console.log(e); $('.super-email-load-wrap').hide(); $('.super-email-notification-wrap .super-email-notification-title').html(e.message); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); // $('.sds-button-loading').hide(); // console.log(e.responseText); }, complete(XMLHttpRequest, status) { // $('.sds-button-loading').hide(); if (status == 'timeout') { // console.log('timeout') } } }); } else { list = { spid: ssid, order_id: order_name, product_id: product_id, review_id: '', product_handle: producthanle, rating: rating, title: $('.sdsReviewTitle').val(), body: $('.sdsReviewEmailBody').val(), reviewer_name: user_name, reviewer_email: user_email, default_image: '', picture_urls1: '', picture_urls2: '', picture_urls3: '', picture_urls4: '', picture_urls5: '', }; console.log(list); $.ajax({ type: "POST", contentType: "application/json;charset=UTF-8", url: "https://dr.supersds.com/user/push_review", data: JSON.stringify(list), success: function(result) { // console.log(result); var resultData = JSON.parse(result); console.log(resultData); $('.super-email-load-wrap').hide(); $('.super-email-notification-wrap .super-email-notification-title').html(resultData.message); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); if (resultData.status == 'success') { localStorage.setItem('reviewPostSuccess', JSON.stringify(resultData)); setTimeout(() => { // window.open('thank-you-review'); window.open('thank-you-review', '_self'); }, 500); } }, error: function(e) { console.log(e); $('.super-email-load-wrap').hide(); // $('.sds-button-loading').hide(); // console.log(e.responseText); $('.super-email-notification-wrap .super-email-notification-title').html(e.message); $('.super-email-notification-wrap').removeClass('hidden').addClass('visible'); setTimeout(() => { $('.super-email-notification-wrap').removeClass('visible').addClass('hidden'); }, 4000); }, complete(XMLHttpRequest, status) { // $('.sds-button-loading').hide(); if (status == 'timeout') { // console.log('timeout'); } } }); } }); });