Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Customizing result mail template

More
4 years 1 month ago - 4 years 1 month ago #7093 by arnaudgautron
Replied by arnaudgautron on topic Customizing result mail template
Hi,

here is my report :-).

1. Editing result mail with TinyMCE
It works fine. Many restrictions though. As usual in HTML emails, you have to use <table> tags to define the layout properly. The CSS styles must be inline, but it's ok, it's usual with HTML emails.

The main restriction to me is that the email produced by Visforms gives you no access to '<head></head' and '<body></body>' tags of the HTML email. In order to give them classes, I can't use Tiny MCE so I tried another way...

2. Overriding php file
I found that the result mail was defined by a Php file called default.php in 'components/com_visforms/lib/mail/adapter/'. I overrided it this way:
- introducing a var $header='<head><style>insert CSS here</style></head>'; in function result();
- around line 77, I changed the following lines
if (isset($emailsettings)) {
$this->resultmailsettings = $header . '<body>' . $emailsettings . '</body>';
}
- i tested it and it works!

3. IT IS NOT A PROPER JOOMLA OVERRIDE, I know that. Using this method, I will loose my override when upgrading visForms (probably).
So, here are my questions:
- is it possible to add this functionnality to further versions of visForms?
- will upgrade still work in the future if I choose to lock the modified file online (with FileZilla).

Thanks for your answer and your work.

Regards,
Arnaud
Last edit: 4 years 1 month ago by arnaudgautron.

More
4 years 1 month ago #7095 by Administrator AV
Replied by Administrator AV on topic Customizing result mail template
Hi Arnaud,

thank you very much for reporting and sharing your results!
I can see that this is akward.
Sorry for that.

I can understand that having the same look and feel in all emails from your website is desirable.
So being able to design to the mails is a feature request which I will support.
Sadly I cannot just add your changes to the Visforms core, because of the fact, that you have to put your custom inline style into the head tag.
I cannot add such custom code to Visforms.

The update save approach to your problem would be to write your own visforms plugin, which implements the onVisformsEmailPrepare($context, $mail, $form) function.
There you can access the $mail->Body and modify it (wrap it the HTML code).

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 :-).

More
4 years 1 month ago #7097 by arnaudgautron
Replied by arnaudgautron on topic Customizing result mail template
Hi Aicha,

I've created a custom visforms plugin, following the official Joomla documentation and your advice and... it works!
If you're interested in it, I can send you (when its fully ok and tested here) my very first Joomla custom plugin :-)
This is pretty cool (I'm initially a webdesigner, not a coder).

Thank you, I can now add custom CSS to any visForms email, this is great news!

Regards,
Arnaud

More
2 years 1 week ago #8569 by Shaman
Replied by Shaman on topic Customizing result mail template

Hi Aicha,

I've created a custom visforms plugin, following the official Joomla documentation and your advice and... it works!
If you're interested in it, I can send you (when its fully ok and tested here) my very first Joomla custom plugin :-)
This is pretty cool (I'm initially a webdesigner, not a coder).

Thank you, I can now add custom CSS to any visForms email, this is great news!

Regards,
Arnaud

 

Good morning Arnaud,

I'm very interested in your solution!

Could you send it to me please? (This email address is being protected from spambots. You need JavaScript enabled to view it.)

Kind regards,
Claude

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum