MemberPress: Filter Email Recipients Based on Expired Memberships

add_filter(‘mepr-wp-mail-recipients’, function($recipients, $subject, $message, $headers) { if (strpos($subject, ‘Subscription renewal’) !== false) { foreach ($recipients as $key => $recipient) { // Extract the email address from the recipient field $regExp = “/]+)>/”; preg_match($regExp, $recipient, $matches); $recipient = $matches[1]; $wp_user =…Continue reading

WP Simple Pay: Translate Stripe Error Messages

/** * @link https://library.wpcode.com/snippet/rov9rl2l/ */ add_filter( ‘simpay_get_localized_error_list’, /** * @param array $messages Stripe error messages. Keyed by error code. * @return array */ function( $messages ) { // https://stripe.com/docs/error-codes#coupon-expired $messages[‘coupon_expired’] = ‘The coupon has expired and is no longer valid’;…Continue reading