-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubscribers.php
34 lines (29 loc) · 1.18 KB
/
subscribers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php must_have_access(); ?>
<script>
function edit_subscriber(id = false) {
var data = {};
data.id = id;
edit_subscriber_modal = mw.tools.open_module_modal('newsletter/edit_subscriber', data, {overlay: true, skin: 'simple'});
}
function delete_subscriber(id) {
var ask = confirm("<?php _ejs('Are you sure you want to delete this subscriber?'); ?>");
if (ask == true) {
var data = {};
data.id = id;
$.ajax({
url: mw.settings.api_url + 'newsletter_delete_subscriber',
type: 'POST',
data: data,
success: function (result) {
mw.notification.success('<?php _ejs('Subscriber deleted'); ?>');
// Reload the modules
mw.reload_module('newsletter/subscribers_list')
mw.reload_module_parent('newsletter')
}
});
}
return false;
}
</script>
<a href="javascript:;" class="btn btn-primary mb-3" onclick="edit_subscriber();"><i class="mdi mdi-plus"></i> <?php _e('Add new subscriber'); ?></a>
<module type="newsletter/subscribers_list"/>