function shipme_new_user_notification_admin($user_id) { $user = new WP_User($user_id); $subject = get_option('shipme_new_user_email_admin_subject'); $message = get_option('shipme_new_user_email_admin_message'); $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); $site_login_url = shipme_login_url(); $site_name = get_bloginfo('name'); $account_url = get_permalink(get_option('shipme_my_account_page_id')); $find = array('##username##', '##user_email##', '##site_login_url##', '##your_site_name##', '##your_site_url##', '##my_account_url##', '##user_password##'); $replace = array($user_login, $user_email, $site_login_url, $site_name, get_bloginfo('siteurl'), $account_url, $plaintext_pass); $message = shipme_replace_stuff_for_me($find, $replace, $message); $subject = shipme_replace_stuff_for_me($find, $replace, $subject); //--------------------------------------------- $email = get_bloginfo('admin_email'); if (!empty($user_email)) { shipme_send_email($email, $subject, $message); } }
function shipme_send_email_posted_job_approved($pid) { $enable = get_option('shipme_new_job_email_approved_enable'); $subject = get_option('shipme_new_job_email_approved_subject'); $message = get_option('shipme_new_job_email_approved_message'); $opt = get_post_meta($pid, 'shipme_send_email_posted_job_approved', true); if ($enable != "no" and empty($opt)) { update_post_meta($pid, 'shipme_send_email_posted_job_approved', '1'); $post = get_post($pid); $user = get_userdata($post->post_author); $site_login_url = shipme_login_url(); $site_name = get_bloginfo('name'); $account_url = get_permalink(get_option('shipme_my_account_page_id')); $post = get_post($pid); $job_name = $post->post_title; $job_link = get_permalink($pid); $find = array('##username##', '##username_email##', '##site_login_url##', '##your_site_name##', '##your_site_url##', '##my_account_url##', '##job_name##', '##job_link##'); $replace = array($user->user_login, $user->user_email, $site_login_url, $site_name, get_bloginfo('siteurl'), $account_url, $job_name, $job_link); $tag = 'shipme_send_email_posted_job_approved'; $find = apply_filters($tag . '_find', $find); $replace = apply_filters($tag . '_replace', $replace); $message = shipme_replace_stuff_for_me($find, $replace, $message); $subject = shipme_replace_stuff_for_me($find, $replace, $subject); //--------------------------------------------- $email = $user->user_email; shipme_send_email($email, $subject, $message); } }