function member_create($user_id, $user_data) { if (is_wp_error($user_id) || !$user_id) { return; } if (empty($user_data['user_login']) || empty($user_data['user_email']) || empty($user_data['user_pass'])) { return; } $vb_user_data = datamanager_init('User', $GLOBALS['vbulletin'], ERRTYPE_ARRAY); $vb_user_data->set('email', $user_data['user_email']); $vb_user_data->set('username', $user_data['user_login']); $vb_user_data->set('password', $user_data['user_pass']); $vb_user_data->pre_save(); if (!empty($vb_user_data->errors)) { $to = get_option('admin_email'); $from = memberaccess_get_email_receipt_address(); $from_description = accesspress_get_option('email_receipt_name'); $subject = __('Error create vBulletin account', 'premise'); $body = sprintf(__("Username: %s\nEmail Address: %s\nError: %s\n\n%s", 'premise'), $user_data['user_login'], $user_data['user_email'], current($vb_user_data->errors), get_option('blogname')); wp_mail($to, $subject, $body, "From: \"{$from_description}\" <{$email_from}>"); } else { $vb_user_id = $vb_user_data->save(); update_user_meta($user_id, 'vbulletin_user_id', $vb_user_id); } }
function premise_recurring_payment_notification($message) { // bundle the message into an email $email_from = memberaccess_get_email_receipt_address(); $from_description = accesspress_get_option('email_receipt_name'); $email_subject = sprintf(__('Premise scheduled payment settlement (%s)', 'premise'), date(get_option('date_format'), time())); wp_mail($email_from, $email_subject, $message, "From: \"{$from_description}\" <{$email_from}>"); die; }
function email_purchase_notification($member, $order_details) { global $product_post, $product_member; if (empty($order_details['_acp_order_product_id']) || !get_post_meta($order_details['_acp_order_product_id'], '_acp_product_email_enabled', true)) { return; } $product_member = get_user_by('id', $member); if (!$product_member || !is_email($product_member->user_email)) { return; } $product_post = get_post($order_details['_acp_order_product_id']); if (empty($product_post)) { return; } $email_subject = get_post_meta($product_post->ID, '_acp_product_email_receipt_subject', true); if (!empty($email_subject)) { $email_subject = do_shortcode($email_subject); } $email_body = get_post_meta($product_post->ID, '_acp_product_email_receipt_intro', true); if (!empty($email_body)) { $email_body = do_shortcode($email_body); } $email_from = memberaccess_get_email_receipt_address(); $from_description = accesspress_get_option('email_receipt_name'); wp_mail($product_member->user_email, $email_subject, $email_body, "From: \"{$from_description}\" <{$email_from}>"); }
function email_purchase_notification($member, $order_details, $skip_email = false, $order_id = 0) { global $product_post, $product_member, $checkout_order; if (empty($order_details['_acp_order_product_id']) || $skip_email || !accesspress_get_custom_field('_acp_product_email_enabled', '', $order_details['_acp_order_product_id'])) { return; } $product_member = get_user_by('id', $member); if (!$product_member || !is_email($product_member->user_email)) { return; } $product_post = get_post($order_details['_acp_order_product_id']); if (empty($product_post)) { return; } $checkout_order = get_post($order_id); $email_subject = get_post_meta($product_post->ID, '_acp_product_email_receipt_subject', true); $email_subject = apply_filters('premise_purchase_notification_subject', $email_subject, $order_details); if (!empty($email_subject)) { $email_subject = do_shortcode($email_subject); } $email_body = get_post_meta($product_post->ID, '_acp_product_email_receipt_intro', true); $email_body = apply_filters('premise_purchase_notification_body', $email_body, $order_details); if (!empty($email_body)) { $email_body = do_shortcode($email_body); } if ($skip_email) { return compact('email_subject', 'email_body'); } $email_from = memberaccess_get_email_receipt_address(); $from_description = accesspress_get_option('email_receipt_name'); wp_mail($product_member->user_email, $email_subject, $email_body, "From: \"{$from_description}\" <{$email_from}>"); }