Last active
June 11, 2016 14:49
-
-
Save timersys/d242f283ecdb49f8a25a4128efe0c0aa to your computer and use it in GitHub Desktop.
Custom email templates for WordPress Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Email Template | |
* | |
* @wordpress-plugin | |
* Plugin Name: Custom Email Template | |
* Plugin URI: http://wordpress.org/plugins/email-templates | |
* Description: Custom template for Email templates plugin | |
* Version: 1.0.0 | |
* Author: Damian Logghe | |
* Author URI: https://timersys.com | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
*/ | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} | |
define( 'CUSTOM_MAILTPL_PLUGIN_FILE' , __FILE__); | |
define( 'CUSTOM_MAILTPL_PLUGIN_DIR' , plugin_dir_path(__FILE__) ); | |
define( 'CUSTOM_MAILTPL_PLUGIN_URL' , plugin_dir_url(__FILE__) ); | |
/** | |
* Replace original template with our custom one | |
*/ | |
add_filter('mailtpl/customizer_template', 'custom_mailtpl_template'); | |
function custom_mailtpl_template( $template ) { | |
return CUSTOM_MAILTPL_PLUGIN_DIR . "/templates/default.php"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment