本文整理匯總了PHP中PMProEmail::sendCheckoutAdminEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMProEmail::sendCheckoutAdminEmail方法的具體用法?PHP PMProEmail::sendCheckoutAdminEmail怎麽用?PHP PMProEmail::sendCheckoutAdminEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PMProEmail
的用法示例。
在下文中一共展示了PMProEmail::sendCheckoutAdminEmail方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pmprosl_pmpro_default_registration_level
function pmprosl_pmpro_default_registration_level($user_id)
{
global $pmpro_level;
//if default is set and we're not otherwise checking out
$default_level = get_option('pmpro_social_login_default_level');
if (!empty($default_level) && empty($pmpro_level) && empty($_REQUEST['level'])) {
pmpro_changeMembershipLevel($default_level, $user_id);
$user = get_userdata($user_id);
$user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($user, false);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($user, false);
}
}
示例2: pmpro_insRecurringRestarted
function pmpro_insRecurringRestarted($morder)
{
global $pmpro_error;
//hook to do other stuff when payments restart
do_action("pmpro_subscription_recuring_restarted", $last_order);
$worked = pmpro_changeMembershipLevel($morder->membership_level->id, $morder->user->ID);
if ($worked === true) {
//$pmpro_msg = __("Your membership has been cancelled.", 'pmpro');
//$pmpro_msgt = "pmpro_success";
//send an email to the member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($morder->user, $morder);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($morder->user, $morder);
inslog("Subscription restarted due to 'recurring restarted' INS notification.");
return true;
} else {
return false;
}
}
示例3: MemberOrder
do_action("pmpro_after_checkout", $user_id, $morder);
//added $morder param in v2.0
//setup some values for the emails
if (!empty($morder)) {
$invoice = new MemberOrder($morder->id);
} else {
$invoice = NULL;
}
$current_user->membership_level = $pmpro_level;
//make sure they have the right level info
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($current_user, $invoice);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($current_user, $invoice);
//redirect to confirmation
$rurl = pmpro_url("confirmation", "?level=" . $pmpro_level->id);
$rurl = apply_filters("pmpro_confirmation_url", $rurl, $user_id, $pmpro_level);
wp_redirect($rurl);
exit;
} else {
//uh oh. we charged them then the membership creation failed
if (isset($morder) && $morder->cancel()) {
$pmpro_msg = __("IMPORTANT: Something went wrong during membership creation. Your credit card authorized, but we cancelled the order immediately. You should not try to submit this form again. Please contact the site owner to fix this issue.", "pmpro");
$morder = NULL;
} else {
$pmpro_msg = __("IMPORTANT: Something went wrong during membership creation. Your credit card was charged, but we couldn't assign your membership. You should not submit this form again. Please contact the site owner to fix this issue.", "pmpro");
}
}
}
示例4: pmpro_ipnChangeMembershipLevel
function pmpro_ipnChangeMembershipLevel($txn_id, &$morder)
{
//filter for level
$morder->membership_level = apply_filters("pmpro_ipnhandler_level", $morder->membership_level, $morder->user_id);
//fix expiration date
if (!empty($morder->membership_level->expiration_number)) {
$enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period, current_time("timestamp"))) . "'";
} else {
$enddate = "NULL";
}
//get discount code
$morder->getDiscountCode();
if (!empty($morder->discount_code)) {
//update membership level
$morder->getMembershipLevel(true);
$discount_code_id = $morder->discount_code->id;
} else {
$discount_code_id = "";
}
//set the start date to current_time('timestamp') but allow filters
$startdate = apply_filters("pmpro_checkout_start_date", "'" . current_time('mysql') . "'", $morder->user_id, $morder->membership_level);
//custom level to change user to
$custom_level = array('user_id' => $morder->user_id, 'membership_id' => $morder->membership_level->id, 'code_id' => $discount_code_id, 'initial_payment' => $morder->membership_level->initial_payment, 'billing_amount' => $morder->membership_level->billing_amount, 'cycle_number' => $morder->membership_level->cycle_number, 'cycle_period' => $morder->membership_level->cycle_period, 'billing_limit' => $morder->membership_level->billing_limit, 'trial_amount' => $morder->membership_level->trial_amount, 'trial_limit' => $morder->membership_level->trial_limit, 'startdate' => $startdate, 'enddate' => $enddate);
global $pmpro_error;
if (!empty($pmpro_error)) {
echo $pmpro_error;
ipnlog($pmpro_error);
}
//change level and continue "checkout"
if (pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false) {
//update order status and transaction ids
$morder->status = "success";
$morder->payment_transaction_id = $txn_id;
if (!empty($_POST['subscr_id'])) {
$morder->subscription_transaction_id = $_POST['subscr_id'];
} else {
$morder->subscription_transaction_id = "";
}
$morder->saveOrder();
//add discount code use
if (!empty($discount_code) && !empty($use_discount_code)) {
$wpdb->query("INSERT INTO {$wpdb->pmpro_discount_codes_uses} (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $morder->user_id . "', '" . $morder->id . "', '" . current_time('mysql') . "");
}
//save first and last name fields
if (!empty($_POST['first_name'])) {
$old_firstname = get_user_meta($morder->user_id, "first_name", true);
if (empty($old_firstname)) {
update_user_meta($morder->user_id, "first_name", $_POST['first_name']);
}
}
if (!empty($_POST['last_name'])) {
$old_lastname = get_user_meta($morder->user_id, "last_name", true);
if (empty($old_lastname)) {
update_user_meta($morder->user_id, "last_name", $_POST['last_name']);
}
}
//hook
do_action("pmpro_after_checkout", $morder->user_id);
//setup some values for the emails
if (!empty($morder)) {
$invoice = new MemberOrder($morder->id);
} else {
$invoice = NULL;
}
$user = get_userdata($morder->user_id);
$user->membership_level = $morder->membership_level;
//make sure they have the right level info
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($user, $invoice);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($user, $invoice);
return true;
} else {
return false;
}
}
示例5: date
function pmpro_ipnChangeMembershipLevel($txn_id, &$morder)
{
//filter for level
$morder->membership_level = apply_filters("pmpro_ipnhandler_level", $morder->membership_level, $morder->user_id);
//fix expiration date
if(!empty($morder->membership_level->expiration_number))
{
$enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period)) . "'";
}
else
{
$enddate = "NULL";
}
//get discount code (NOTE: but discount_code isn't set here. How to handle discount codes for PayPal Standard?)
$use_discount_code = true; //assume yes
if(!empty($discount_code) && !empty($use_discount_code))
$discount_code_id = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_discount_codes WHERE code = '" . $discount_code . "' LIMIT 1");
else
$discount_code_id = "";
//set the start date to NOW() but allow filters
$startdate = apply_filters("pmpro_checkout_start_date", "NOW()", $morder->user_id, $morder->membership_level);
//custom level to change user to
$custom_level = array(
'user_id' => $morder->user_id,
'membership_id' => $morder->membership_level->id,
'code_id' => $discount_code_id,
'initial_payment' => $morder->membership_level->initial_payment,
'billing_amount' => $morder->membership_level->billing_amount,
'cycle_number' => $morder->membership_level->cycle_number,
'cycle_period' => $morder->membership_level->cycle_period,
'billing_limit' => $morder->membership_level->billing_limit,
'trial_amount' => $morder->membership_level->trial_amount,
'trial_limit' => $morder->membership_level->trial_limit,
'startdate' => $startdate,
'enddate' => $enddate);
global $pmpro_error;
if(!empty($pmpro_error))
{
echo $pmpro_error;
ipnlog($pmpro_error);
}
if(pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false)
{
//update order status and transaction ids
$morder->status = "success";
$morder->payment_transaction_id = $txn_id;
if(!empty($_POST['subscr_id']))
$morder->subscription_transaction_id = $_POST['subscr_id'];
else
$morder->subscription_transaction_id = "";
$morder->saveOrder();
//add discount code use
if(!empty($discount_code) && !empty($use_discount_code))
{
$wpdb->query("INSERT INTO $wpdb->pmpro_discount_codes_uses (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $current_user->ID . "', '" . $morder->id . "', now())");
}
//save first and last name fields
if(!empty($_POST['first_name']))
{
$old_firstname = get_user_meta($morder->user_id, "first_name", true);
if(!empty($old_firstname))
update_user_meta($morder->user_id, "first_name", $_POST['first_name']);
}
if(!empty($_POST['last_name']))
{
$old_lastname = get_user_meta($morder->user_id, "last_name", true);
if(!empty($old_lastname))
update_user_meta($morder->user_id, "last_name", $_POST['last_name']);
}
//hook
do_action("pmpro_after_checkout", $morder->user_id);
//setup some values for the emails
if(!empty($morder))
$invoice = new MemberOrder($morder->id);
else
$invoice = NULL;
$user = get_userdata($morder->user_id);
$user->membership_level = $morder->membership_level; //make sure they have the right level info
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($user, $invoice);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($user, $invoice);
return true;
}
//.........這裏部分代碼省略.........
示例6: pmpro_insChangeMembershipLevel
function pmpro_insChangeMembershipLevel($txn_id, &$morder)
{
$recurring = pmpro_getParam('rectoken', 'POST');
//filter for level
$morder->membership_level = apply_filters("pmpro_inshandler_level", $morder->membership_level, $morder->user_id);
//set the start date to current_time('mysql') but allow filters (documented in preheaders/checkout.php)
$startdate = apply_filters("pmpro_checkout_start_date", "'" . current_time('mysql') . "'", $morder->user_id, $morder->membership_level);
//fix expiration date
if (!empty($morder->membership_level->expiration_number)) {
$enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period, current_time("timestamp"))) . "'";
} else {
$enddate = "NULL";
}
//filter the enddate (documented in preheaders/checkout.php)
$enddate = apply_filters("pmpro_checkout_end_date", $enddate, $morder->user_id, $morder->membership_level, $startdate);
//get discount code
$morder->getDiscountCode();
if (!empty($morder->discount_code)) {
//update membership level
$morder->getMembershipLevel(true);
$discount_code_id = $morder->discount_code->id;
} else {
$discount_code_id = "";
}
//custom level to change user to
$custom_level = array('user_id' => $morder->user_id, 'membership_id' => $morder->membership_level->id, 'code_id' => $discount_code_id, 'initial_payment' => $morder->membership_level->initial_payment, 'billing_amount' => $morder->membership_level->billing_amount, 'cycle_number' => $morder->membership_level->cycle_number, 'cycle_period' => $morder->membership_level->cycle_period, 'billing_limit' => $morder->membership_level->billing_limit, 'trial_amount' => $morder->membership_level->trial_amount, 'trial_limit' => $morder->membership_level->trial_limit, 'startdate' => $startdate, 'enddate' => $enddate);
global $pmpro_error;
if (!empty($pmpro_error)) {
//echo $pmpro_error;
fnlog($pmpro_error);
}
if (pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false) {
//update order status and transaction ids
$morder->status = "success";
$morder->payment_transaction_id = $txn_id;
if (!$recurring) {
$morder->subscription_transaction_id = $txn_id;
} else {
$morder->subscription_transaction_id = '';
}
$morder->saveOrder();
//add discount code use
if (!empty($discount_code) && !empty($use_discount_code)) {
$wpdb->query("INSERT INTO {$wpdb->pmpro_discount_codes_uses} (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $morder->user_id . "', '" . $morder->id . "', '" . current_time('mysql') . "')");
}
//hook
do_action("pmpro_after_checkout", $morder->user_id);
//print_r ($morder); die;
//setup some values for the emails
if (!empty($morder)) {
$invoice = new MemberOrder($morder->id);
} else {
$invoice = NULL;
}
fnlog("CHANGEMEMBERSHIPLEVEL: ORDER: " . var_export($morder, true) . "\n---\n");
$user = get_userdata($morder->user_id);
if (empty($user)) {
return false;
}
$user->membership_level = $morder->membership_level;
//make sure they have the right level info
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($user, $invoice);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($user, $invoice);
return true;
} else {
return false;
}
}
示例7: pmpro_insSaveOrder
function pmpro_insSaveOrder($txnref, $last_order)
{
global $wpdb;
//check that txn_id has not been previously processed
$old_txn = $wpdb->get_var("SELECT payment_transaction_id FROM {$wpdb->pmpro_membership_orders} WHERE payment_transaction_id = '" . $txnref . "' LIMIT 1");
if (empty($old_txn)) {
//hook for successful subscription payments
do_action("pmpro_subscription_payment_completed");
//save order
$morder = new MemberOrder();
$morder->user_id = $last_order->user_id;
$morder->membership_id = $last_order->membership_id;
$morder->payment_transaction_id = $txnref;
$morder->subscription_transaction_id = $last_order->subscription_transaction_id;
$morder->InitialPayment = $last_order->InitialPayment;
//$_POST['item_list_amount_1']; //not the initial payment, but the class is expecting that
$morder->PaymentAmount = $last_order->PaymentAmount;
//$_POST['item_list_amount_1'];
$morder->gateway = $last_order->gateway;
$morder->gateway_environment = $last_order->gateway_environment;
//save
$morder->saveOrder();
$pmproemail = new PMProEmail();
$pmproemail->sendInvoiceEmail($user_id, $morder);
$user = get_userdata($morder->user_id);
$user->membership_level = $morder->membership_level;
//make sure they have the right level info
//send email to member
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutEmail($user_id, $morder);
//send email to admin
$pmproemail = new PMProEmail();
$pmproemail->sendCheckoutAdminEmail($user_id, $morder);
$morder->getMemberOrderByID($morder->id);
// //email the user their invoice
$pmproemail = new PMProEmail();
$pmproemail->sendInvoiceEmail(get_userdata($last_order->user_id), $morder);
if (strpos(PMPRO_INS_DEBUG, "@")) {
$log_email = PMPRO_INS_DEBUG;
} else {
$log_email = get_option("admin_email");
}
inslog("New order (" . $morder->code . ") created.");
return true;
} else {
inslog("Duplicate Transaction ID: " . $txnref);
return false;
}
}