WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › filter customer details in html emails
- AuthorPosts
- 25 July, 2014 at 10:38 am #4505
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; }
25 July, 2014 at 11:46 am #4508THANKS VERY MUCH
8 August, 2015 at 1:01 pm #11430hi olly
you could have a filter like this, even for the text of the gateway?
thanks8 August, 2015 at 1:10 pm #11431i don’t understand.
what text of what gateway ?8 August, 2015 at 3:19 pm #11432sorry!
the text of the order email
cash on delivery
or paypal
Thank!8 August, 2015 at 4:12 pm #11433just rename the frontend label . can’t see a need for any filter there….
8 August, 2015 at 4:22 pm #11434I wanted the text to be bold and a bit bigger! if possible.
8 August, 2015 at 5:02 pm #11437there are already tons of filters in the email template you can use.
in your case probably this one:
wppizza_filter_htmlemail_head_info
8 August, 2015 at 11:41 pm #11445I failed 🙁
10 August, 2015 at 12:59 am #11455what did you try ?
10 August, 2015 at 1:22 am #11456I 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
10 August, 2015 at 2:02 am #11457that 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);
10 August, 2015 at 2:43 am #11458Thank!!!!! Olly. :)))
- AuthorPosts
- The topic ‘filter customer details in html emails’ is closed to new replies.