function ass_change_all_email_sub() { global $groups_template, $bp; if (!is_super_admin()) { return false; } $group =& $groups_template->group; if (!($default_email_sub = ass_get_default_subscription($group))) { $default_email_sub = 'no'; } echo '<p><br>' . __('Site Admin Only: update email subscription settings for ALL members to the default:', 'bp-ass') . ' <i>' . ass_subscribe_translate($default_email_sub) . '</i>. ' . __('Warning: this is not reversible so use with caution.', 'bp-ass') . ' <a href="' . wp_nonce_url(bp_get_group_permalink($group) . 'admin/manage-members/email-all/' . $default_email_sub, 'ass_change_all_email_sub') . '">' . __('Make it so!', 'bp-ass') . '</a></p>'; }
/** * BPGES: Reformat the email footer to use HTML for group activity items. * * @param string $retval The current email contents * @param array $data { * Array of data. * @type string $message The full email content excluding footer * @type string $notice The email footer * @type int $user_id The user ID posting the content * @type string $subscription_type Email subscription type for the receiver of * the email. * @type string $content The unmodified post content * @type string $settings_link The settings link for the receiver of the email. * } * @return string */ public function adjust_ges_activity_email_footer($retval, $data) { $content = ''; $footer = ''; $footer_links = array(); switch ($data['subscription_type']) { // self-notifications case 'self_notify': $footer = sprintf(__('You are currently receiving notifications for your own posts. To disable these notifications, <a href="%s">login here</a> and uncheck "Receive notifications of your own posts"', 'wpbe-bp'), $data['settings_link']); $content = sprintf(__('%1$s <hr /> %2$s'), $data['content'], $footer); break; // 'new topics' or 'all mail' // 'new topics' or 'all mail' case 'sub': case 'supersub': $footer = sprintf(__('Your email setting for this group is: ', 'wpbe-bp') . '<strong>' . ass_subscribe_translate($data['subscription_type']) . '</strong>'); $footer_links[] = sprintf('<a href="%1$s">%2$s</a>', $data['settings_link'], __('Change Group Email Settings', 'wpbe-bp')); $footer_links[] = $this->get_bpges_group_unsubscribe_link($data['user_id']); if ('yes' == get_option('ass-global-unsubscribe-link')) { $footer_links[] = $this->get_bpges_global_unsubscribe_link($data['user_id']); } $footer_links = implode(' · ', $footer_links); $content = sprintf(__('%1$s <hr /> %2$s %3$s'), $data['content'], $footer, $footer_links); break; } return apply_filters('wpbe_bp_ass_activity_email_content', $content, $footer, $footer_links, $data); }