392 lines
13 KiB
HTML
392 lines
13 KiB
HTML
<table class="form-table">
|
|
<tbody>
|
|
<!-- email addresses receiving notifications -->
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="settings[notification_email]">
|
|
<%= __("Email notifications") %>
|
|
<p class="description">
|
|
<%= __('Enter the email addresses that should receive notifications (separate by comma).') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<input type="text"
|
|
id="settings[notification_email]"
|
|
name="notification[address]"
|
|
value="<%= settings.notification.address %>"
|
|
placeholder="notification@mydomain.com"
|
|
class="regular-text" />
|
|
</p>
|
|
<p>
|
|
<label for="settings[notification_on_subscribe]">
|
|
<input type="checkbox" id="settings[notification_on_subscribe]"
|
|
name="notification[on_subscribe]"
|
|
value="1"
|
|
<% if(settings.notification.on_subscribe) %>checked="checked"<% endif %> />
|
|
<%= __('When someone subscribes') %>
|
|
</label>
|
|
</p>
|
|
<p>
|
|
<label for="settings[notification_on_unsubscribe]">
|
|
<input type="checkbox"
|
|
id="settings[notification_on_unsubscribe]"
|
|
name="notification[on_unsubscribe]"
|
|
value="1"
|
|
<% if(settings.notification.on_unsubscribe) %>checked="checked"<% endif %> />
|
|
<%= __('When someone unsubscribes') %>
|
|
</label>
|
|
</p>
|
|
<!-- email notification: from name & email -->
|
|
<p>
|
|
<label for="settings[from_name]"><%= __('From') %></label>
|
|
<input type="text"
|
|
id="settings[from_name]"
|
|
name="sender[name]"
|
|
value="<%= settings.sender.name %>"
|
|
placeholder="<%= __('Your name') %>" />
|
|
<input type="text"
|
|
id="settings[from_email]"
|
|
name="sender[address]"
|
|
value="<%= settings.sender.address %>"
|
|
placeholder="info@mydomain.com" />
|
|
</p>
|
|
<!-- email notification: reply_to name & email -->
|
|
<p>
|
|
<label for="settings[notification_reply_name]"><%= __('Reply-to') %></label>
|
|
<input type="text"
|
|
id="settings[notification_reply_name]"
|
|
name="reply_to[name]"
|
|
value="<%= settings.reply_to.name %>"
|
|
placeholder="<%= __('Your name') %>" />
|
|
<input type="text"
|
|
id="settings[notification_reply_email]"
|
|
name="reply_to[address]"
|
|
value="<%= settings.reply_to.address %>"
|
|
placeholder="info@mydomain.com" />
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<!-- ability to subscribe in comments -->
|
|
<!-- TODO: Check if registration is enabled (if not, display a message and disable setting) -->
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="settings[subscribe_on_comment]">
|
|
<%= __('Subscribe in comments') %>
|
|
<p class="description"><%= __('Visitors who submit a comment on a post can click on a checkbox to subscribe.') %></p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<input
|
|
data-toggle="mailpoet_subscribe_on_comment"
|
|
type="checkbox"
|
|
value="1"
|
|
id="settings[subscribe_on_comment]"
|
|
name="subscribe[on_comment][enabled]"
|
|
<% if(settings.subscribe.on_comment.enabled) %>checked="checked"<% endif %>
|
|
/>
|
|
</p>
|
|
<div id="mailpoet_subscribe_on_comment">
|
|
<p>
|
|
<input
|
|
type="text"
|
|
id="settings[subscribe_on_comment_label]"
|
|
name="subscribe[on_comment][label]"
|
|
class="regular-text"
|
|
<%if(settings.subscribe.on_comment.label) %>
|
|
value="<%= settings.subscribe.on_comment.label %>"
|
|
<% else %>
|
|
value="<%= __('Yes, add me to your mailing list.') %>"
|
|
<% endif %>
|
|
/>
|
|
</p>
|
|
<p>
|
|
<label><%= __('Users will be subscribed to these lists:') %></label>
|
|
</p>
|
|
<p>
|
|
<select
|
|
id="mailpoet_subscribe_on_comment_segments"
|
|
name="subscribe[on_comment][segments][]"
|
|
data-placeholder="<%= __('Choose a list') %>"
|
|
multiple
|
|
>
|
|
<% for segment in segments %>
|
|
<option
|
|
value="<%= segment.id %>"
|
|
<% if(segment.id in settings.subscribe.on_comment.segments) %>
|
|
selected="selected"
|
|
<% endif %>
|
|
><%= segment.name %></option>
|
|
<% endfor %>
|
|
</select>
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<!-- ability to subscribe when registering -->
|
|
<!-- TODO: Only available for the main site of a multisite! -->
|
|
<!-- TODO: Check if registration is enabled (if not, display a message and disable setting) -->
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="settings[subscribe_on_register]">
|
|
<%= __('Subscribe in registration form') %>
|
|
<p class="description">
|
|
<%= __('Allow users who register to your site to subscribe on a list of your choice.') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<% if(flags.registration_enabled == true) %>
|
|
<p>
|
|
<input
|
|
data-toggle="mailpoet_subscribe_in_form"
|
|
type="checkbox"
|
|
value="1"
|
|
id="settings[subscribe_on_register]"
|
|
name="subscribe[on_register][enabled]"
|
|
<% if(settings.subscribe.on_register.enabled) %>
|
|
checked="checked"
|
|
<% endif %>
|
|
/>
|
|
</p>
|
|
|
|
<div id="mailpoet_subscribe_in_form">
|
|
<p>
|
|
<input
|
|
type="text"
|
|
id="settings[subscribe_on_register_label]"
|
|
name="subscribe[on_register][label]"
|
|
class="regular-text"
|
|
<%if(settings.subscribe.on_register.label) %>
|
|
value="<%= settings.subscribe.on_register.label %>"
|
|
<% else %>
|
|
value="<%= __('Yes, add me to your mailing list.') %>"
|
|
<% endif %>
|
|
/>
|
|
</p>
|
|
<p>
|
|
<label><%= __('Users will be subscribed to these lists:') %></label>
|
|
</p>
|
|
<p>
|
|
<select
|
|
id="mailpoet_subscribe_on_register_segments"
|
|
name="subscribe[on_register][segments][]"
|
|
data-placeholder="<%= __('Choose a list') %>"
|
|
multiple
|
|
>
|
|
<% for segment in segments %>
|
|
<option
|
|
value="<%= segment.id %>"
|
|
<% if(segment.id in settings.subscribe.on_register.segments) %>
|
|
selected="selected"
|
|
<% endif %>
|
|
><%= segment.name %></option>
|
|
<% endfor %>
|
|
</select>
|
|
</p>
|
|
</div>
|
|
<% else %>
|
|
<p>
|
|
<em><%= __('Registration is disabled on this site.') %></em>
|
|
</p>
|
|
<% endif %>
|
|
</td>
|
|
</tr>
|
|
<!-- edit subscription-->
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="subscription_manage_page">
|
|
<%= __('Manage Subscription page') %>
|
|
<p class="description">
|
|
<%= __('The page your subscribers see when they click on "Manage your subscription" in your emails.') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<select
|
|
class="mailpoet_page_selection"
|
|
id="subscription_manage_page"
|
|
name="subscription[pages][manage]"
|
|
>
|
|
<% for page in pages %>
|
|
<option
|
|
value="<%= page.id %>"
|
|
data-preview-url="<%= page.url.manage|raw %>"
|
|
<% if(page.id == settings.subscription.pages.manage) %>
|
|
selected="selected"
|
|
<% endif %>
|
|
><%= page.title %></option>
|
|
<% endfor %>
|
|
</select>
|
|
<a
|
|
class="mailpoet_page_preview"
|
|
href="javascript:;"
|
|
title="<%= __('Preview page') %>"
|
|
><%= __('Preview') %></a>
|
|
</p>
|
|
<p>
|
|
<label><%= __('Subscribers can choose from these lists:') %></label>
|
|
</p>
|
|
<p>
|
|
<select
|
|
id="mailpoet_subscription_edit_segments"
|
|
name="subscription[segments][]"
|
|
data-placeholder="<%= __('Leave empty to show all lists') %>"
|
|
multiple
|
|
>
|
|
<% for segment in segments %>
|
|
<option
|
|
value="<%= segment.id %>"
|
|
<% if(segment.id in settings.subscription.segments) %>
|
|
selected="selected"
|
|
<% endif %>
|
|
><%= segment.name %></option>
|
|
<% endfor %>
|
|
</select>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<!-- unsubscribe-->
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="subscription_unsubscribe_page">
|
|
<%= __('Unsubscribe page') %>
|
|
<p class="description">
|
|
<%= __('The page your subscribers see when they click on "Unsubscribe" in your emails.') %>
|
|
<br />
|
|
<%= __('Use this shortcode in your own pages: [mailpoet_manage text="Manage your subscription"].') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<select
|
|
class="mailpoet_page_selection"
|
|
id="subscription_unsubscribe_page"
|
|
name="subscription[pages][unsubscribe]"
|
|
>
|
|
<% for page in pages %>
|
|
<option
|
|
value="<%= page.id %>"
|
|
data-preview-url="<%= page.url.unsubscribe|raw %>"
|
|
<% if(page.id == settings.subscription.pages.unsubscribe) %>
|
|
selected="selected"
|
|
<% endif %>
|
|
><%= page.title %></option>
|
|
<% endfor %>
|
|
</select>
|
|
<a
|
|
class="mailpoet_page_preview"
|
|
href="javascript:;"
|
|
title="<%= __('Preview page') %>"
|
|
><%= __('Preview') %></a>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<!-- shortcode: archive page -->
|
|
<tr>
|
|
<th scope="row">
|
|
<label>
|
|
<%= __('Archive page shortcode') %>
|
|
<p class="description">
|
|
<%= __('Paste this shortcode in a page to display a list of past newsletters.') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<input
|
|
type="text"
|
|
class="regular-text"
|
|
id="mailpoet_shortcode_archives"
|
|
value="[mailpoet_archive]"
|
|
onClick="this.focus();this.select();"
|
|
readonly="readonly"
|
|
/>
|
|
</p>
|
|
<p>
|
|
<select
|
|
id="mailpoet_shortcode_archives_list"
|
|
data-shortcode="mailpoet_archive"
|
|
data-output="mailpoet_shortcode_archives"
|
|
data-placeholder="<%= __('Leave empty to show all lists') %>"
|
|
multiple
|
|
>
|
|
<% for segment in segments %>
|
|
<option value="<%= segment.id %>"><%= segment.name %></option>
|
|
<% endfor %>
|
|
</select>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<!-- shortcode: total number of subscribers -->
|
|
<tr>
|
|
<th scope="row">
|
|
<label>
|
|
<%= __('Shortcode to display total number of subscribers') %>
|
|
<p class="description">
|
|
<%= __('Paste this shortcode to display the number of confirmed subscribers in post or page.') %>
|
|
</p>
|
|
</label>
|
|
</th>
|
|
<td>
|
|
<p>
|
|
<input
|
|
type="text"
|
|
class="regular-text"
|
|
id="mailpoet_shortcode_subscribers"
|
|
value="[mailpoet_subscribers_count]"
|
|
onClick="this.focus();this.select();"
|
|
readonly="readonly"
|
|
/>
|
|
</p>
|
|
<p>
|
|
<select
|
|
id="mailpoet_shortcode_subscribers_count"
|
|
data-shortcode="mailpoet_subscribers_count"
|
|
data-output="mailpoet_shortcode_subscribers"
|
|
data-placeholder="<%= __('Leave empty to show all lists') %>"
|
|
multiple
|
|
>
|
|
<% for segment in segments %>
|
|
<option value="<%= segment.id %>"><%= segment.name %></option>
|
|
<% endfor %>
|
|
</select>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
// on dom loaded
|
|
$(function() {
|
|
// select2 instances
|
|
$('#mailpoet_subscribe_on_comment_segments').select2();
|
|
$('#mailpoet_subscribe_on_register_segments').select2();
|
|
$('#mailpoet_subscription_edit_segments').select2();
|
|
$('#mailpoet_shortcode_archives_list').select2();
|
|
$('#mailpoet_shortcode_subscribers_count').select2();
|
|
|
|
// shortcodes
|
|
$('#mailpoet_shortcode_archives_list, #mailpoet_shortcode_subscribers_count')
|
|
.on('change', function() {
|
|
var shortcode = $(this).data('shortcode'),
|
|
values = $(this).val() || [];
|
|
|
|
if (values.length > 0) {
|
|
shortcode += ' segments="';
|
|
shortcode += values.join(',');
|
|
shortcode += '"';
|
|
}
|
|
|
|
$('#' + $(this).data('output'))
|
|
.val('[' + shortcode + ']');
|
|
});
|
|
});
|
|
});
|
|
</script> |