Support

Admin Tools

#35211 Geoinfo "missing" in email templates on fresh install

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by Ch3vr0n on Thursday, 13 May 2021 09:45 CDT

Ch3vr0n

Just installed AAT 6.0.5 on a new site and configured. As expected i was notified of a succesful SU login. Now i know its been a while since the GEOip information was removed due to licensing restrictions, but it seems that perhaps an e-mail template was overlooked in removing the placeholder information from it.

The specific templates in question are "adminloginsuccess" and "adminloginfail". The default email templates installed with 6.0.5 still contain the geoip placeholders for

Country*: [COUNTRY]
Continent*: [CONTINENT]

Obviously nothing that can't be easily fixed manually. Figured i'd let you know since afaik there's no point in having those placeholders anymore if geoip info is no longer supported (and hasn't been for a while).

nicholas
Akeeba Staff
Manager

We removed this feature in January 2020. The (legal) reasons are explained in https://www.akeeba.com/news/1727-removal-of-geographic-ip-features-from-akeeba-software.html

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Ch3vr0n

I'm afraid you're missunderstanding me Nicholas. I'm not saying if this was removed (i mentioned that at the beginning that I knew it was). I'm asking/saying that BECAUSE that feature shouldn't those placeholders that still exist be removed from the admin templates too? As they no longer serve a purpose? Or are they left in place intentionally

nicholas
Akeeba Staff
Manager

Sorry, the title of the ticket and the body said different things so I rolled the dice to figure out what you really meant.

Indeed, the default email templates still have these old references. Thank you for noting this, I will change them for the next release.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Ch3vr0n

I had "missing" in quotes ", perhaps it was overlooked. Glad i could be of service! Just a thought (unless you've already thought of this too), if it's possible, have the new version detect if the default templates are used and those placeholders are present, and if someone is using the default ones have the installer overwrite them with the new templates or offer the user the choice if they wish to override the existing default ones with the new ones.

 

As i don't know if the default templates would get updated with the fix, or that the fix would only be for new installs. Obviously the decision is yours to make. Just a thought. I'll await the next update!

nicholas
Akeeba Staff
Manager

if it's possible, have the new version detect if the default templates are used and those placeholders are present, and if someone is using the default ones have the installer overwrite them with the new templates 

This is something I had asked myself the very first time I had to edit the templates to remove the backlit to our software. The answer is no. If you do as much as open and save the template you might get its source code formatted differently so it's no longer the same string. Trying to remove all HTML tags and comparing the plain text versions would work BUT it would also replace your templates if you kept the same text and only changed the formatting. Therefore detection is unlikely to work properly.

On top of that, we're moving towards using the Joomla! core MVC for our Joomla 4 extensions. This makes any kind of conditional replacement of database data unlikely.

Joomla 4 does have an email template feature but to those of us who have actually been doing this for more than a decade it looks half-baked. Nevermind the bad user experience or the myriad problems a user would have figuring it out. The biggest problem is that the HTML emails it generates are invalid and caught as spam by SpamAssassin... Of course I didn't expect anything better given who cobbled together this component. Some people have a mouth that's orders of magnitude bigger than their software development talent. Let's just leave it at that.

I'm also seriously contemplating whether it makes sense to have an email template editor using the WYSIWYG Joomla HTML editor. Nevermind that if you edit it with the wrong user you might lose the formatting, it may overwrite your formatting or doesn't allow you to use all tags which could be used in an HTML email. The main problem is the editor only returns the content inside the BODY element of the document it's editing. However, an HTML email needs to be a well-formed HTML document, with an HTML root element, a HEAD and a BODY. Right now we're working around that programmatically but this limits you in the sense that you can't put custom CSS in the HEAD, therefore you can only use inline styles. If you want to do things like dark mode emails you need stylesheets and they don't work across all mail clients when the stylesheet is inside the BODY.

I have tried a solution in Akeeba Subscriptions (the software we use to manage subscriptions on our site). Instead of language strings or email templates in the database we use Joomla view templates. You can override them using Joomla's template management page and even edit them with the code editor provided (they're PHP files, after all). You can also edit them on any code or HTML editor you please and upload them with SFTP / FTP / hosting control panel file manager. They are far more versatile. I think that this is very likely where we'll be heading. It will certainly take some experimentation.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Ch3vr0n

If it's not possible, it's not possible. 30 second manual fix :) Thanks for the info!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!