Relative URL's in email

JackGoa

Member
Hi, I use JCE Editor. By default, JCE uses 'relative urls' for any internal linking. In the past this was not a problem when using an article as an email template. Fabrik, I'm guessing, inserted the correct URL. Lately however, I noticed that it has become a problem whereby any internal linking excludes the domain name which obviously results in a link in an email where the client will end up nowhere.

Has something changed on Fabrik's side, or should I just go change that setting in JCE on all my sites?
 
I just noticed, I changed the settings in JCE to display absolute URL's and I still get a relative URL link in the email. So this is definitely a Fabrik issue.
 
As far as I know we've never corrected those JCE internal URLs. When I use JCE, I set it to use absolute. But I very rarely use JCE now, as it's a pain in the backside.

-- hugh
 
I just opened the article again, and double checked that I saved it properly, tested and absolute URL included in email.

For anyone else with this issue, make sure you set JCE to use Absolute URL's, and make sure you go re-save the article afterwards.

Thanks anyway Hugh, I'll just go fix it on all my other sites then.

PS, I have tested this in the past as it was a concern and I definitely did receive the absolute URL in the email, even though I did not change the default JCE setting (relative URL's). I am 110% positive on this one.
 
I do have a vague memory of trying to defend against that in our code, I'll see if we ever did have anything.

-- hugh
 
Nope, nothing in out code which would have done it. I remember ages ago trying out some code, but that was back in 2.1, never made it into the 3.x code.

-- hugh
 
That is so weird. I remember being worried about this and testing it over and over and over and it worked fine, even though while editing an article, I could clearly see the relative URL.

It's cool, not a huge hassle. I'll just switch JCE on the sites where it will be an issue.
 
Hugh, just out of interest. I've been switching JCE to absolute urls since this thread. The only reason is obviously for the links in emails.

There is a drawback to this though. Any urls in the content of your site then switches to the non-SEF urls. Not good for SEO purposes.

This seems to be a miscommunication between Joomla and JCE somewhere along the way.

So I'm now developing the habit of leaving JCE to relative, but when I'm done setting up my email template, I toggle the editor off and just add the domain bit to all links. Painful, but only solution for now.

bj?rn
- from tapatalk
 
You can define multiple profiles in JCE for different users, groups, components...
So you can set up one with and one without absolute pathes.

@Hugh: wouldn't it make sense to convert to absolute pathes in emails in general (as it is done for PDFs)? I think there's a helper somewhere.
 
That's a very clever idea Troester. Would need to logout and and login again with a different profile but probably faster than editing HTML.

bj?rn
- from tapatalk
 
@troester - the helper is in ./components/com_fabrik/helpers/pdf.php, and for PDF's it's part of the main pdf document rendering, so from ./library/joomla/document/pdf/pdf.php ...

Yes it would be possible to run the email template output through it.

If anyone want to try it, I'd suggest somewhere around line 173 in the ./plugins/fabrik_form/email/email.php, once we've completely finished building $message, add ...

Code:
FabrikPDFHelper::fullPaths($message);

I think you'll also need to require the PDF helper, as I don't think we include that as part of the normal Fabrik framework, so up top of the file ...

Code:
require_once JPATH_SITE . '/components/com_fabrik/helpers/pdf.php';

-- hugh
 
For reals? So URLs in article email templates will now be checked to make sure they're absolute and not relative?

bj?rn
- from tapatalk
 
No ways! Thanks so much! Haha. Thought it was just one of those things I'm going to have to live with.

It makes sense that it is a needed feature though.

Thanks a million troester and hugh! Fabrik has the best support I've ever seen. Most helpful people.

bj?rn
- from tapatalk
 
Hi troester. I just tested this. JCE editor, saved the email article template (relative URL's enabled). Sent a test mail, and the mail that arrived did not have the absolute path, only relative.
 
Ah, yes.
At the moment the replacement is only done for links starting with a / - and JCE links are starting without...
 
A simple workaround:
just put a / before the relative link which is inserted via JCE (file or image selection) into the link field.
 
No ways! That simple? Great. Thanks for the advice. I normally use JCE's browser to find menu items to link to. It's really easy to just add a / from there. It's not like there's a lot of links in an email anyway.

I don't suppose there is some clever trick to embed an image in an email without the user having to click on "download images?

bj?rn
- from tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top