Hello,
My question is regarding to EventOrganizer PRO – Booking email.
I have trouble to pass Booking specific data in QR code attached to Booking confirmation email.
I have created custom email template, placed it in my custom theme, so far so good.
I am able to use Booking data specified (such as %booking_reference%, %tickets%, %event_date%, %event_title%) in text part of my custom email.
But when I try to pass these values in url, QR image is generated without it or not at all.
QR code is generated dynamically from this code:
img src="https://api.paylibo.com/paylibo/generator/czech/image?accountNumber=123456789&bankCode=1234&amount=Booking+Value+Here¤cy=CZK&vs=BookingRefHere&ss=2023&message=Event+Title+Here" alt="QR code"
Is there a way I can use/store Booking data and pass it to this part of email please?
kubaS
kuba sanitrák
Solved it myself.
In case anyone ever needs faces similar issue:
- I registered my own email tags for eo_pro (using file
“register-email-tags.php”)
- their values are modified values of default eo email tags
(event_title, booking_amount) – spaces in strings replaced with “+”
and striped decimals and currency symbols from amount
- In html markup of email I then pass these tags and QR image is generated on email submission
Full markup for generating image with QR code payment instructions here:
img src="https://api.paylibo.com/paylibo/generator/czech/image?accountNumber=123456789&bankCode=123&amount=%qr_booking_amount%¤cy=CZK&vs=%booking_reference%&ss=2023&message=Booking+for+%qr_event_title%" alt="QR code payment instructions"
Cheers,
kubaS
kuba sanitrák
You can achieve this without editing the plug-in files directly (changes to the plug-in will be lost during an upgrade):
<?php
add_action('init', function(){
EO_Email_Template_Tag_Registry::register( 'qr_code', function($tag, $atts, $context ){
$event_id = $context['event_id'];
$booking_id = $context['booking_id'];
$html = "<p>desired html mark-up</p>"
return $html;
});
});
<?php endif; ?>
See also https://wp-event-organiser.com/blog/tutorial/including-custom-fields-confirmation-e-mail/ and on where to put custom code snippets: https://wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/
Stephen Harris