• Hi..
    I want to do something on mailtpl/send_email action, but it didn’t work. Here’s my code.

    
    add_action('mailtpl/send_email', 'my_custom');
    function my_custom($args) {
    
    	$emailsubject = $args['subject'];
    	$emailmessage = $args['message'];
    
    	// Replace
    	$args['message'] = str_replace('%%TITLE%%', $emailsubject, $emailmessage);
    
    	// Format Subject
    	$args['subject'] = '[My Website] - '.$emailsubject;
    
    }
    
Viewing 1 replies (of 1 total)
  • Hi,
    To change the subject or message, you can use the “wp_mail” hook.

    
    function timersys_send_email( $args ) {
    	
    	//$args['to']
    	//$args['subject']
    	//$args['message']
    
    	return $args;
    }
    
    add_filter( 'wp_mail', 'timersys_send_email', 101 );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Placeholder from Subject’ is closed to new replies.