Skip to content

Instantly share code, notes, and snippets.

@amdrew
Created March 16, 2015 20:51
Show Gist options
  • Save amdrew/91d739be2d22b35feb06 to your computer and use it in GitHub Desktop.
Save amdrew/91d739be2d22b35feb06 to your computer and use it in GitHub Desktop.
<?php
/**
* Change the referral email
*/
function affwp_emails_referral_email( $message, $args ) {
$email = affwp_get_affiliate_email( $args['affiliate_id'] );
$amount = html_entity_decode( affwp_currency_filter( $args['amount'] ), ENT_COMPAT, 'UTF-8' );
$message = sprintf( __( "Congratulations %s!\n\n", "affiliate-wp" ), affiliate_wp()->affiliates->get_affiliate_name( $args['affiliate_id'] ) );
$message .= sprintf( __( "You have been awarded a new referral of %s on %s!\n\n", "affiliate-wp" ), $amount, home_url() );
$message .= sprintf( __( "Log into your affiliate area to view your earnings or disable these notifications: %s\n\n", "affiliate-wp" ), affiliate_wp()->login->get_login_url() );
$message .= "Add your extra line here or modify the above";
return $message;
}
add_filter( 'affwp_new_referral_email', 'affwp_emails_referral_email', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment