filter customer details in html emails

WPPizza – A WordPress Plugin Support Code Snippets (read only) filter customer details in html emails

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #4505

    Olly
    Admin & Mod

    for example – instead of modifying the html email template directly – you could bold some customer details in the html emails like so (put this in your themes function.php file)

    
    /**filter customer details in html emails**/
    add_filter('wppizza_filter_customer_details_html', 'my_custom_customer_details_html');
    function my_custom_customer_details_html($customerDetails) {
    	/**bold the output/value of the 4th field (zero indexed)**/
    	$customerDetails[3]['value']='<b>'.$customerDetails[3]['value'].'</b>';
    	
    	return $customerDetails;	
    }
    
    #4508

    mubi
    Participant

    THANKS VERY MUCH

    #11430

    bruno
    Participant

    hi olly
    you could have a filter like this, even for the text of the gateway?
    thanks

    #11431

    Olly
    Admin & Mod

    i don’t understand.
    what text of what gateway ?

    #11432

    bruno
    Participant

    sorry!
    the text of the order email
    cash on delivery
    or paypal
    Thank!

    #11433

    Olly
    Admin & Mod

    just rename the frontend label . can’t see a need for any filter there….

    #11434

    bruno
    Participant

    I wanted the text to be bold and a bit bigger! if possible.

    #11437

    Olly
    Admin & Mod

    there are already tons of filters in the email template you can use.

    in your case probably this one:

    wppizza_filter_htmlemail_head_info

    #11445

    bruno
    Participant

    I failed 🙁

    #11455

    Olly
    Admin & Mod

    what did you try ?

    #11456

    bruno
    Participant

    I tried to use this but https://www.wp-pizza.com/topic/filteredit-header-of-html-emails/ I do not know what to add and how to make bold @gatewaylabel

    #11457

    Olly
    Admin & Mod

    that filter is just for the customer details. if you want to filter the header info (the part that includes the gateway selection), you need to use *that* filter i mentioned above with the relevant variables . i.e something like this

    
    function myprefix_filter_html_head_info($htmlEmailHeadInfo,  $htmlEmailStyle, $orderLabel, $nowdate, $gatewayLabel, $transactionId) {
    
    	$htmlEmailHeadInfo['paymentdetails']='<tr><td colspan="2" style="'.$htmlEmailStyle['mailPadding']['2x0x0x15'].'">'.$orderLabel['order_paid_by'].' <strong>'.$gatewayLabel.'</strong> ('.$transactionId.')</td></tr>';
    
    	return $htmlEmailHeadInfo;
    }
    add_filter('wppizza_filter_htmlemail_head_info', 'myprefix_filter_html_head_info',10,6);
    
    #11458

    bruno
    Participant

    Thank!!!!! Olly. :)))

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘filter customer details in html emails’ is closed to new replies.