Experiencing a 401 Unauthorized Error During Update?
If you're seeing a 401 Unauthorized error when trying to update your Joomla extension, it's likely due to our new two-factor authentication (2FA) security measure for your Download ID.
To resolve this, check your email (Spam folder?) for a message to approve your server or device, or read our detailed blog post here(
onlinecommunityhub.nl/best-practice/new-...-extension-downloads) to understand the steps involved. This will guide you through approving your server for future updates.
Implemented Email templates relative paths
- Sakis Terz
- Topic Author
- Offline
- Posts: 36
- Thank you received: 0
I am using some links and some images in my email templates, but every time i re-open them the urls become relevant (e.g. <a href="subscribe").
Not sure if there is some filtering from the editor or is coming from your code.
Any idea?
Kind regards,
Please Log in to join the conversation.
- Ruud van Lent
- Offline
- Posts: 1649
- Thank you received: 107
that is a editor 'feature' that (depending on your editor) can be turned on / off: note that this is then generic so when turning it off it will also be turned off in other extensions.
What I do is before saving the email template, turn off the editor (and check if all URL's are still absolute)
Please Log in to join the conversation.
- Ruud van Lent
- Offline
- Posts: 1649
- Thank you received: 107
so did a deeper dive into this to see if I can improve
In the email send ochSubscriptions adds the following line:
<base href="[your domain]" />
What this does / should do, is instruct the email client to make a relative url (e.g. test-url) absolute (so: [your domain]/test-url)
This way you can use both absolute and relative urls in your email templates as these will then be handled by the email client.
but... what if the email client doesn't use / respect the 'base href' setting? Then the absolute urls will work, but the relative urls will not (as these point to nowhere).
tinyMCE can be configured to store urls as relative or absolute: this has impact on everything the editor is used for, so when changing it to store absolute urls (which we want in emails) then also in articles all urls will be absolute (which we don't want)...
So in the version above I have a version of ochSubscriptions that will convert all elements (a, img, link, script, form, input, video, audio, source) in the email template to absolute URLs when rendering and sending the email (so not in the template itself).
This way you can either use absolute or relative urls: absolute will stay unchanged 9as these can also point to another website) and relative urls will be made absolute pointing to your site.
Can you give this a test to see if it works as intended and solves this url nightmare
Please Log in to join the conversation.
- Sakis Terz
- Topic Author
- Offline
- Posts: 36
- Thank you received: 0
Sorry for the late reply. I tried both the [your domain] and [your_domain] and they do not work.
Btw. I see that the email placeholders are using curly braces {}
Kind regards,
Sakis
Please Log in to join the conversation.
- Ruud van Lent
- Offline
- Posts: 1649
- Thank you received: 107
I think there is some confusion. With [you domain] I mean you actual website domain.
So on my server that would be:
- https /onlinecommunityhub .nl/testlink
- or /testlink
Please Log in to join the conversation.
- Sakis Terz
- Topic Author
- Offline
- Posts: 36
- Thank you received: 0
Is there a placeholder I could use, instead of my actual domain?
Please Log in to join the conversation.
- Sakis Terz
- Topic Author
- Offline
- Posts: 36
- Thank you received: 0
Please Log in to join the conversation.
- Ruud van Lent
- Offline
- Posts: 1649
- Thank you received: 107
In version 4.0.1 I have added the updated logic to always add the local domain name to the url: so when the editor strips it, when ochSubscriptions renders the email text from the template it will add it back
Please Log in to join the conversation.
- Sakis Terz
- Topic Author
- Offline
- Posts: 36
- Thank you received: 0
I am currently on 3.13.3
Is 4.0.1 compatible with J4?
Please Log in to join the conversation.
- Ruud van Lent
- Offline
- Posts: 1649
- Thank you received: 107
in your current install, locate file ContentConstructor.php and replace the function "prepareEmailBody" with the one below:
BACKUP and TEST
Please Log in to join the conversation.