|
@@ 761-779 (lines=19) @@
|
| 758 |
|
$get_error_info = 'blog revision or published'; |
| 759 |
|
|
| 760 |
|
$watchers = get_subscribers($dbprefix, $author_id, $content_id); |
| 761 |
|
foreach ($watchers as $watcher) { |
| 762 |
|
$message['user_name'] = $watcher->username; |
| 763 |
|
|
| 764 |
|
$template = elgg_view('cp_notifications/email_template', $message); |
| 765 |
|
|
| 766 |
|
$recipient_user = get_user($watcher->guid); |
| 767 |
|
|
| 768 |
|
if (has_access_to_entity($entity, $recipient_user) && $entity->access_id != 0) { |
| 769 |
|
if (strcmp(elgg_get_plugin_user_setting('cpn_set_digest', $watcher->guid,'cp_notifications'), 'set_digest_yes') == 0) |
| 770 |
|
create_digest($author, $action_type, $content_entity, get_entity($watcher->guid)); |
| 771 |
|
else{ |
| 772 |
|
(elgg_is_active_plugin('phpmailer')) ? phpmailer_send($watcher->email, $watcher->name, $subject, $template, NULL, true) : mail($watcher->email, $subject, $template, cp_get_headers()); |
| 773 |
|
count_emails($message['cp_en_entity']); |
| 774 |
|
} |
| 775 |
|
|
| 776 |
|
if (check_entity_relationship($watcher->guid, 'cp_subscribed_to_site_mail', $entity->getContainerGUID())) |
| 777 |
|
messages_send($subject, $template, $watcher->guid, $site->guid, 0, true, false); |
| 778 |
|
} |
| 779 |
|
} |
| 780 |
|
return true; |
| 781 |
|
} |
| 782 |
|
|
|
@@ 806-828 (lines=23) @@
|
| 803 |
|
|
| 804 |
|
$watchers = get_subscribers($dbprefix, $current_user->guid, $entity->guid); |
| 805 |
|
|
| 806 |
|
foreach ($watchers as $watcher) { |
| 807 |
|
$message['user_name'] = $watcher->username; |
| 808 |
|
$template = elgg_view('cp_notifications/email_template', $message); |
| 809 |
|
$recipient_user = get_user($watcher->guid); |
| 810 |
|
|
| 811 |
|
if (has_access_to_entity($entity, $recipient_user) /*&& $object->access_id != 0*/) { |
| 812 |
|
|
| 813 |
|
if (strcmp(elgg_get_plugin_user_setting('cpn_set_digest', $watcher->guid,'cp_notifications'),'set_digest_yes') == 0) { |
| 814 |
|
|
| 815 |
|
create_digest($author, $action_type, $content_entity, get_entity($watcher->guid)); |
| 816 |
|
} |
| 817 |
|
else { |
| 818 |
|
(elgg_is_active_plugin('phpmailer')) ? phpmailer_send( $watcher->email, $watcher->name, $subject, $template, NULL, true ) : mail($watcher->email, $subject, $template, cp_get_headers()); |
| 819 |
|
count_emails($message['cp_en_entity']); |
| 820 |
|
} |
| 821 |
|
|
| 822 |
|
|
| 823 |
|
if (check_entity_relationship($watcher->guid, 'cp_subscribed_to_site_mail', $entity->getContainerGUID())) { |
| 824 |
|
$site_template = elgg_view('cp_notifications/site_template', $message); |
| 825 |
|
messages_send($subject, $site_template, $watcher->guid, $site->guid, 0, true, false); |
| 826 |
|
} |
| 827 |
|
} |
| 828 |
|
} |
| 829 |
|
return true; |
| 830 |
|
} |
| 831 |
|
|