Skip to content

Instantly share code, notes, and snippets.

@amdrew
Created December 3, 2014 21:38
Show Gist options
  • Select an option

  • Save amdrew/2ae8420de8b6ca28bf6a to your computer and use it in GitHub Desktop.

Select an option

Save amdrew/2ae8420de8b6ca28bf6a to your computer and use it in GitHub Desktop.
AffiliateWP - Change the emails from plain text to HTML, filter the application accepted email
<?php
/**
* Change the email content types to HTML
*/
function affwp_custom_email_headers( $headers ) {
$headers[] = "Content-type: text/html";
return $headers;
}
add_filter( 'affwp_email_headers', 'affwp_custom_email_headers' );
/**
* Filter the application accepted email
*/
function affwp_custom_application_accepted_email( $message, $args ) {
ob_start();
?>
<p>Congratulations <?php echo affiliate_wp()->affiliates->get_affiliate_name( $args['affiliate_id'] ); ?>!</p>
<p>Your affiliate application on <?php echo home_url(); ?> has been accepted!</p>
<p>Log into your affiliate area at <?php echo get_permalink( affiliate_wp()->settings->get( 'affiliates_page' ) ); ?> </p>
<p>Add some more HTML</p>
<?php
return ob_get_clean();
}
add_filter( 'affwp_application_accepted_email', 'affwp_custom_application_accepted_email', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment