} if (class_exists(MAILUSERS_PMPRO_CLASS) && !empty($send_pmpro)) { $recipients = array_merge($recipients, mailusers_get_recipients_from_membership_levels($send_pmpro, $exclude_id, MAILUSERS_ACCEPT_MASS_EMAIL_USER_META)); } if (!empty($send_roles)) { $recipients = array_merge($recipients, mailusers_get_recipients_from_roles($send_roles, $exclude_id, MAILUSERS_ACCEPT_MASS_EMAIL_USER_META)); } if (empty($recipients)) { ?> <p><strong><?php _e('No recipients were found.', MAILUSERS_I18N_DOMAIN); ?> </strong></p> <?php } else { $num_sent = mailusers_send_mail($recipients, $subject, $mail_content, $mail_format, $from_name, $from_address); if (false === $num_sent) { print '<div class="error fade"><p> ' . __('There was a problem trying to send email to users.', MAILUSERS_I18N_DOMAIN) . '</p></div>'; } else { if (0 === $num_sent) { print '<div class="error fade"><p>' . __('No email has been sent to other users. This may be because no valid email addresses were found.', MAILUSERS_I18N_DOMAIN) . '</p></div>'; } else { if ($num_sent > 0 && $num_sent == count($recipients)) { ?> <div class="updated fade"> <p><?php echo sprintf(__('Email sent to %s user(s).', MAILUSERS_I18N_DOMAIN), $num_sent); ?> </p> </div> <?php
} ?> <div class="wrap"> <?php // Fetch users // -- $recipients = mailusers_get_recipients_from_ids(array($user_ID)); if (empty($recipients)) { ?> <p><strong><?php _e('No recipients were found.', MAILUSERS_I18N_DOMAIN); ?> </strong></p> <?php } else { $useheader = mailusers_get_header_usage() != 'notification'; $usefooter = mailusers_get_footer_usage() != 'notification'; mailusers_send_mail($recipients, $subject, $mail_content, $mail_format, $from_name, $from_address, $useheader, $usefooter); ?> <div class="updated fade"> <p><?php echo sprintf(__("Test email sent to %s.", MAILUSERS_I18N_DOMAIN), $from_address); ?> </p> </div> <?php } ?> </div>