Joomla 5 Mitteilung

Wir freuen uns mitteilen zu können, dass seit dem 29. Januar 2024 alle unsere Joomla Erweiterungen mit Joomla 5 kompatible sind.

Für alle die gerade noch von Joomla 3 auf 4 aktualisieren: Anleitungen für die Joomla 4 Migration gibt es hier:

Es gibt nun auch eine eigenständige Dokumentation für Visforms für Joomla 4 und für Visforms auf Joomla 5

Forum

Visforms Subscription Inhaber können in unserem Forum Fragen stellen. Bitte mit dem entsprechenden Benutzer anmelden.
Jeder kann lesend auf das Forum zugreifen.

Bitte stellen Sie nur 1 Frage pro Thema.

Wichtig Angaben für fast jede Frage:
V1: Welche Visforms-Version läuft?
V2: Welche Joomla-Version läuft?
V3: Welche PHP-Version läuft?

File link is not good in result e-mail

Mehr
6 Jahre 9 Monate her #5352 von GESign
File link is not good in result e-mail wurde erstellt von GESign
Dear Aicha,

I would like to get a clickable link in my result e-mail to access the files from the server.
(File attachment is working fine, just my Cu. can not open attachments because of securiy reason.)

So I tried this code in result mail text :
<a href="[FILEUPLOAD]">[FILEUPLOAD]</a>
The result is this:
domain.com/https://domain.com/tmp/001_5ab372eaac9c3.jpg

So the domain with http tag is duplicated.

How could I get the good result in e-mail, please. ( domain.com/tmp/001_5ab372eaac9c3.jpg )

I have tried some options but non of them worked. I use v3.10.4.

Thank you and best regards,
Andrew

Mehr
6 Jahre 9 Monate her #5353 von GESign
We can not see but the links are containing the https:// tags twice as well. So the beginnings start with https:// .Thanks and regards, Andrew

Mehr
6 Jahre 9 Monate her #5354 von Administrator AV
Administrator AV antwortete auf File link is not good in result e-mail
Hi,

I'm sorry for your trouble. At the moments there are limits, to what you can do with the placeholders especially with any field types that can envolve links (url, upload, email). Using a placeholder of an upload field in a href attribute of a link was not an intended use and there are combinations of settings of the form options with which this is not going to work

Cleaning up the placeholder code and the mails is the next point on my todo list but I have not manage to do so, yet.

Your main problem is, that you have set the receipt mail option "Show a download link" to "yes" (in the form configuration). This effects the placeholder which you us in any custom mail text.

One way to solve the problem would be to set the receipt mail option "Show a download link" to "no". Maybe you do not need this option anyway and it is just an accident, that it is set to yes. If you are really sending a receipt mail and do include the data and do want to show a download link in the receipt mail, then you have to fix this as described later.

After the option is set to "no" you can use the placeholder for the upload field in your resul mail text but you have to add the folder (tmp) to the href as well.
<a href="tmp/[FILEUPLOAD]">[FILEUPLOAD]</a>
The text, displayed in the mail will only be the file name then, the href should be the correct link to the file.

If you are really sending a receipt mail and do include the data and do want to show a download link in the receipt mail you can use the Receipt Mail Text and add a link just as with the result mail.

I hope this will fix your problem.

The good thing is, that I'm now aware of this problem and, during refactoring the code, I can take a look and try to improve this.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Mehr
6 Jahre 9 Monate her #5355 von GESign
Dear Aicha,

Unfortunately this solution is not working yet because of it adds the correct original file name but the server has the file name modified. For example:
Original file name: 001.jpg
File name on server: 001_5ab3a2cde064e.jpg
So we would need the server file name in the link.

When I don't take the a tag around the file link then the link is perfect just not clickable. Could I change it to clickable in an easy way, or get the modified filename on server?

Best regards,
Andrew

Mehr
6 Jahre 9 Monate her - 6 Jahre 9 Monate her #5356 von Administrator AV
Administrator AV antwortete auf File link is not good in result e-mail
Hi Andrew,

you are correct. I didn't take that into account.

As I said, the placeholder was actually not ment to be used in the href of a link to the file. At the moment I see no easy solution for this.

There is one more thing which you could try.
The mails are created in the file components/com_visforms/models/visforms.php. There is a separate function for the result mail and the receipt mail.
You could try the following modification in the code of the function sendResultMail, which creates the result mail.
Replace (line 901)
Code:
if ((!empty($visform->emailresulttext))) { $fixedLinks = JHTMLVisforms::fixLinksInMail($visform->emailresulttext); $body[] = JHTMLVisforms::replacePlaceholder($visform, $fixedLinks); }

With
Code:
if ((!empty($visform->emailresulttext))) { $replacedText = JHTMLVisforms::replacePlaceholder($visform, $visform->emailresulttext); $body[] = JHTMLVisforms::fixLinksInMail($replacedText); }
In theory switching the order in which the text is processed, should fix the problem, but first, I have not tested at all and second, I'm not absolutely sure, if changing the order in which the text is processed may cause a problem at any other point. Therefore I cannot promise, that I can merge this change into the Visforms core, even if it works for you.
If you want to try this, make a copy of the visforms.php file first!!!

I think it is not necessary to modify the function for the receipt mail, because displaying a link is a feature in the receipt mail and does already work.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).
Letzte Änderung: 6 Jahre 9 Monate her von Administrator AV.

Mehr
6 Jahre 9 Monate her #5357 von GESign
Dear Aicha,

It didn't work for me.

I would like to ask more infos about "displaying a link is a feature in the receipt mail and does already work". What is "displaying a link"? Maybe a switch what I didn't switch.

Thank you and best regards,
Andrew

Moderatoren: Administrator AVAdministrator IV
Powered by Kunena Forum