Files
piratepoet/views/settings/basics.html
Pavel Dohnal cdbb8d7c62 Display sender warning on settings page
[MAILPOET-1573]
2019-01-24 10:43:11 +01:00

453 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="settings[from_name]">
<%= __("Default sender") %>
</label>
<p class="description">
<%= __('These email addresses will be selected by default for each new email.') %>
</p>
</th>
<td>
<div id="settings_sender_container"></div>
<script type="text/javascript">
var mailpoet_settings_sender_name = "<%= settings.sender.name %>";
var mailpoet_settings_sender_adddress = "<%= settings.sender.address %>";
var mailpoet_settings_reply_to_name = "<%= settings.reply_to.name %>";
var mailpoet_settings_reply_to_address = "<%= settings.reply_to.address %>";
</script>
</td>
</tr>
<!-- email addresses receiving notifications -->
<tr style="display:none">
<th scope="row">
<label for="settings[notification_email]">
<%= __("Email notifications") %>
</label>
<p class="description">
<%= __('These email addresses will receive notifications (separate each address with a comma).') %>
</p>
</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>
</td>
</tr>
<!-- ability to subscribe in comments -->
<tr>
<th scope="row">
<label for="settings[subscribe_on_comment]">
<%= __('Subscribe in comments') %>
</label>
<p class="description">
<%= __('Visitors that comment on a post can subscribe to your list via a checkbox.') %>
</p>
</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 %> (<%= segment.subscribers %>)</option>
<% endfor %>
</select>
</p>
</div>
</td>
</tr>
<!-- ability to subscribe when registering -->
<tr>
<th scope="row">
<label for="settings[subscribe_on_register]">
<%= __('Subscribe in registration form') %>
</label>
<p class="description">
<%= __('Allow users who register as a WordPress user on your website to subscribe to a MailPoet list (in addition to the "WordPress Users" list).') %>
</p>
</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 %> (<%= segment.subscribers %>)</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') %>
</label>
<p class="description">
<%= __('When your subscribers click the "Manage your subscription" link, they will be directed to this page.') %>
<br />
<%= __('If you want to use a custom Subscription page, simply paste this shortcode on to a WordPress page: [mailpoet_manage_subscription]') %>
</p>
</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') %>"
data-automation-id="preview_manage_subscription_page_link"
><%= __('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 this field empty to display all lists') %>"
multiple
>
<% for segment in segments %>
<option
value="<%= segment.id %>"
<% if(segment.id in settings.subscription.segments) %>
selected="selected"
<% endif %>
><%= segment.name %> (<%= segment.subscribers %>)</option>
<% endfor %>
</select>
</p>
</td>
</tr>
<!-- unsubscribe-->
<tr>
<th scope="row">
<label for="subscription_unsubscribe_page">
<%= __('Unsubscribe page') %>
</label>
<p class="description">
<%= __('When your subscribers click the "Unsubscribe" link, they will be directed to this page.') %>
<br />
<%= __('If you want to use a custom Unsubscribe page, simply paste this shortcode on to a WordPress page: [mailpoet_manage text="Manage your subscription"]') %>
</p>
</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') %>"
data-automation-id="unsubscribe_page_preview_link"
><%= __('Preview') %></a>
</p>
</td>
</tr>
<!-- New subscriber emails notifications -->
<tr>
<th scope="row">
<label for="subscription_unsubscribe_page">
<%= __('New subscriber notifications') %> <span id="new_subscriber_announcement" class="new_subscriber_announcement" />
</label>
<p class="description">
<%= __('Enter the email address that should receive notifications when someone subscribes.') %>
<td>
<p>
<label>
<input
type="radio"
name="subscriber_email_notification[enabled]"
value="1"
<% if(settings.subscriber_email_notification.enabled) %>
checked
<% endif %>
/><%= __('Yes') %>
</label>
&nbsp;
<label>
<input
type="radio"
name="subscriber_email_notification[enabled]"
value=""
<% if not(settings.subscriber_email_notification.enabled) %>
checked
<% endif %>
/><%= __('No') %>
</label>
<br>
<input type="email"
id="subscriber_email_notification[address]"
name="subscriber_email_notification[address]"
value="<%= settings.subscriber_email_notification.address %>"
placeholder="me@mydomain.com" />
<br>
<div id="settings_subscriber_email_notification_error" class="mailpoet_error_item mailpoet_error">
<%= __('Please fill the email address.') %>
</div>
<!-- shortcode: archive page -->
<tr>
<th scope="row">
<label>
<%= __('Archive page shortcode') %>
</label>
<p class="description">
<%= __('Paste this shortcode on a page to display a list of past newsletters.') %>
</p>
</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 this field empty to display all lists') %>"
multiple
>
<% for segment in segments %>
<option value="<%= segment.id %>"><%= segment.name %> (<%= segment.subscribers %>)</option>
<% endfor %>
</select>
</p>
</td>
</tr>
<!-- shortcode: total number of subscribers -->
<tr>
<th scope="row">
<label>
<%= __('Shortcode to display total number of subscribers') %>
</label>
<p class="description">
<%= __('Paste this shortcode on a post or page to display the total number of confirmed subscribers.') %>
</p>
</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 this field empty to display all lists') %>"
multiple
>
<% for segment in segments %>
<option value="<%= segment.id %>"><%= segment.name %> (<%= segment.subscribers %>)</option>
<% endfor %>
</select>
</p>
</td>
</tr>
<!-- gdpr compliant -->
<tr>
<th scope="row">
<label>
<%= __('Be GDPR compliant') %>
</label>
<p class="description">
<%= __('You need to comply with European law in regards to data privacy if you have European subscribers. Rest assured, its easy!') %>
</p>
</th>
<td>
<p>
<a
href="https://beta.docs.mailpoet.com/article/246-guide-to-conform-to-gdpr"
title="<%= __('Read our guide') %>"
target="_blank"
><%= __('Read our guide') %></a>
</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();
// fix lengthy placeholder from being cut off by select 2
$('.select2-search__field').each(function() {
$(this).css('width', ($(this).attr('placeholder').length * 0.75) + 'em');
});
// 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>