#2052 – No images in the confirmation email

Posted in ‘Taxi Booking’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Sunday, 21 February 2021 16:03 GMT
serguei_kp
SystemPay for Taxi Booking, Taxi Booking recurring updates Annually
Hello, when I'm updating order status or driver name, the confirmation email sent to client and admin does not display driver photo and company logo image.

This is because I'm updating it through SOAP API, the path to the SOAP file is:
https://aramis-paris.com/administrator/components/com_virtuemart_erp/services/methods/VOB_SOAP_Queries.php

In the email the url of the image is like this:
https://aramis-paris.com/administrator/components/com_virtuemart_erp/services/images/Site-general/Aramis_transfers_black_logo.png"
while it should be like this:
https://aramis-paris.com/images/Site-general/Aramis_transfers_black_logo.png"

I found that the base url of the site is changed when I'm updating orders status and driver with the SOAP API,
and inside Taxibooking in: components\com_taxibooking\helpers\common.php
the function changeEditorImageUrl($text) uses this SOAP base url instead of usual base url.

I found how to modify this function in the way that it strips the useless part of the url which is:
"administrator/components/com_virtuemart_erp/services/"

I can copy past it on the live site, but with every update of Taxibooking, I should copy paste this function in the site's file every time.
The question is:
May be you can integrate it in the next updated release of the Taxibooking?
Here is the modified function, I added only one line:
function changeEditorImageUrl($text)
{
$base = JURI::root();
$base = preg_replace("/\/administrator\/components\/com_virtuemart_erp\/services\//", "", $base);
$text = preg_replace("/(src)=\"(?!http|ftp|https)([^\"]*)\"/", "$1=\"$base\$2\"", $text);
return $text;
}

Serge.
 
Sunday, 21 February 2021 16:46 GMT
serguei_kp
SystemPay for Taxi Booking, Taxi Booking recurring updates Annually
Update:

function changeEditorImageUrl($text)
{
$base = JURI::root();
$base = preg_replace("/administrator\/components\/com_virtuemart_erp\/services\//", "", $base);
$text = preg_replace("/(src)=\"(?!http|ftp|https)([^\"]*)\"/", "$1=\"$base\$2\"", $text);
return $text;
}
 
Monday, 22 February 2021 12:44 GMT
serguei_kp
SystemPay for Taxi Booking, Taxi Booking recurring updates Annually
Now I need to make same for driver image in the email.
Because above solution works only for logo image in the email.
But for driver image url, I see only solution in modifying email template file, but I would not like to touch this file.


Do you know an easy solution to modify image url in the email template from this:
img src="http://localhost/administrator/components/com_virtuemart_erp/services/images/Site-general/Aramis_transfers_black_logo.png"

to this:
img src="http://localhost/images/Site-general/Aramis_transfers_black_logo.png"

When I accessing the site with soap api, it modifies the base url, adding the soap file path to the base url.
 
Monday, 22 February 2021 14:39 GMT
serguei_kp
SystemPay for Taxi Booking, Taxi Booking recurring updates Annually
Until I will found more elegant solution I will patch next files:
booking.helper.php
confirmation_email.tpl.php
archive_email.tpl.php

The function below puts in variable $base_url the correct root url of the site,
and I will replace in email templates
JURI::root()
by
$base_url

function changeBaseUrl()
{
$base = JURI::root();
$base = preg_replace("/administrator\/components\/com_virtuemart_erp\/services\//", "", $base);
return $base;
}
$base_url = changeBaseUrl();

May be you have ideas about more elegant and less intrusive solution?
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

KANEV Web Development limited is not affiliated with or endorsed by the Joomla Project or Open Source Matters.

KANEV Web Development limited is registered in England and Wales #8902407