-
Notifications
You must be signed in to change notification settings - Fork 15
/
rcp-email-manual-payment.php
45 lines (35 loc) · 1.29 KB
/
rcp-email-manual-payment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Plugin Name: Restrict Content Pro - Email After Manual Payment
* Description: Emails a member after they sign up with the "Manual" payment gateway.
* Version: 1.0
* Author: Sandhills Development, LLC
* Author URI: https://sandhillsdev.com
* License: GPL2
*/
/**
* Emails a member after they sign up with the "Manual" payment gateway.
* You can use this email to send further instructions on how to submit
* payment via cheque, bank transfer, etc.
*/
/**
* Email the member a new manual payment is received (and is pending).
*
* @param RCP_Member $member
* @param int $payment_id
* @param RCP_Payment_Gateway_Manual $gateway
*
* @return void
*/
function ag_rcp_email_member_on_manual_payment( $member, $payment_id, $gateway ) {
$subject = 'Please complete your payment to activate your membership';
$message = 'Hello %name%,
Please send your payment to us via bank transfer or cheque to activate your membership.
Your invoice is available here: %invoice_url%
Thank you.';
$emails = new RCP_Emails;
$emails->member_id = $member->ID;
$emails->payment_id = $payment_id;
$emails->send( $member->user_email, $subject, $message );
}
add_action( 'rcp_process_manual_signup', 'ag_rcp_email_member_on_manual_payment', 20, 3 );