Split support inquiries into Free and Premium inboxes [MAILPOET-869]
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
define([], function() {
|
||||
!function(e, o, n){window.HSCW=o, window.HS=n, n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={}, t.readyQueue=[], t.config=function(e){this.userConfig=e}, t.ready=function(e){this.readyQueue.push(e)}, o.config={docs:{enabled:!0, baseUrl:"//mailpoet3.helpscoutdocs.com/"}, contact:{enabled:!0, formId:"aa21ca80-a4f5-11e6-91aa-0a5fecc78a4d"}};var r=e.getElementsByTagName("script")[0], c=e.createElement("script");c.type="text/javascript", c.async=!0, c.src="https://djtflbt20bdde.cloudfront.net/", r.parentNode.insertBefore(c, r)}(document, window.HSCW||{}, window.HS||{});
|
||||
});
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace MailPoet\Twig;
|
||||
use MailPoet\Config\ServicesChecker;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
@ -66,6 +67,11 @@ class Functions extends \Twig_Extension {
|
||||
array($this, 'getMailPoetPremiumVersion'),
|
||||
array('is_safe' => array('all'))
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'mailpoet_has_valid_premium_key',
|
||||
array($this, 'hasValidPremiumKey'),
|
||||
array('is_safe' => array('all'))
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'wp_time_format',
|
||||
array($this, 'getWPTimeFormat'),
|
||||
@ -151,4 +157,9 @@ class Functions extends \Twig_Extension {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function hasValidPremiumKey() {
|
||||
$checker = new ServicesChecker();
|
||||
return $checker->isPremiumKeyValid(false);
|
||||
}
|
||||
}
|
@ -75,6 +75,12 @@ jQuery('.toplevel_page_mailpoet-newsletters.menu-top-last')
|
||||
|
||||
<%= javascript('lib/analytics.js') %>
|
||||
|
||||
<% if mailpoet_has_valid_premium_key() %>
|
||||
<script>!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!0,baseUrl:"//mailpoet3.helpscoutdocs.com/"},contact:{enabled:!0,formId:"6974b88d-8d85-11e7-b5b5-0ec85169275a"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});</script>
|
||||
<% else %>
|
||||
<script>!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!0,baseUrl:"//mailpoet3.helpscoutdocs.com/"},contact:{enabled:!0,formId:"dd918048-8d73-11e7-b5b5-0ec85169275a"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});</script>
|
||||
<% endif %>
|
||||
|
||||
<script type="text/javascript">
|
||||
if(window['HS'] !== undefined) {
|
||||
// HelpScout Beacon: Configuration
|
||||
|
@ -36,7 +36,6 @@ var baseConfig = {
|
||||
'wp-js-hooks': 'WP-JS-Hooks/src/event-manager.js',
|
||||
'blob$': 'blob-tmp/Blob.js',
|
||||
'papaparse': 'papaparse/papaparse.min.js',
|
||||
'helpscout': 'helpscout.js',
|
||||
'html2canvas': 'html2canvas/dist/html2canvas.js',
|
||||
'asyncqueue': 'vendor/jquery.asyncqueue.js'
|
||||
},
|
||||
@ -118,10 +117,6 @@ var baseConfig = {
|
||||
include: require.resolve('handlebars'),
|
||||
loader: 'expose-loader?Handlebars',
|
||||
},
|
||||
{
|
||||
include: /helpscout.js$/,
|
||||
loader: 'exports-loader?window.HS',
|
||||
},
|
||||
{
|
||||
include: /html2canvas.js$/,
|
||||
loader: 'expose-loader?html2canvas',
|
||||
@ -177,7 +172,6 @@ var adminConfig = {
|
||||
'settings/reinstall_from_scratch.js',
|
||||
'subscribers/importExport/import.js',
|
||||
'subscribers/importExport/export.js',
|
||||
'helpscout'
|
||||
],
|
||||
form_editor: [
|
||||
'form_editor/form_editor.js',
|
||||
|
Reference in New Issue
Block a user