CalcBuilder Forum

Issues with HTML in emails to users

User TheFencepedia 2025-04-25 19:07:17

Hi there,

I've just updated the email that is sent to users when they use a calculator on my website.

You can see the setup for that email on the first attachment.

However, as you can see on the second attachment, all HTML elements are stripped out.

The previous configuration used to send the former email with all HTML content in it, inlcuding to the same user.

I have just spent a LOT of time manually updating hundreds of calculators with the new message. I do not want to have to manually fix this, so I need a solution from you.

Thanks.

User TheFencepedia 2025-04-25 19:07:49

Here is the email. Can't attach two files.

Moonsoft support 2025-04-28 09:28:49

Hi,
we do see the html being sent in the email, because there is a line with bold letters that wouldn't show otherwise. The image tag also seems to be there, but with wrong/not accesible url (maybe relative?). The email function is sending exactly the content saved at the editor, however, it seems also to be other weird content included, for ex the tags that are not html. Can you please go to any of the emails, switch your editor to the 'code' tab, and attach an screenshot of the code here? We'll check the html you've build and let you know oor findings.

Best regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-04-28 17:14:25

Sure. Here's the code.

I really hope I don't have to manually fix nearly 300 individual instances of this, particularly since there are no instructions of any kind on this page....

If there is an issue, can you please provide information about how to change the message for all calculators at the same time? Or provide some functionality to do that? This is a very inefficient system!


<p>Your DrawAFence.com custom shop drawing is attached.</p>
<p><strong>You can now access your drawings on the <a href="index.php?Itemid=1153" target="_blank">My Files</a> menu.</strong></p>
<p>You can ONLY access drawings generated on your account when logged into that account, and you can search or filter by client name, project name, date, drawing number and revision.</p>
<p>This applies only to NEW drawings created after 24 April 2025.</p>
<p>Remember, if you notice any errors or issues with any drawings or generators, please send us a <a href="index.php?Itemid=648" target="_blank">Bug Report</a>, and if you need a drawing we have not got to yet, please send us a <a href="index.php?Itemid=219" target="_blank">Drawing Request</a>.</p>
<p><img src="images/Draw%20A%20Fence%20Logo%20200px.png" alt="Draw A Fence Logo 200px" width="250" height="68" /></p>

Moonsoft support 2025-04-29 14:27:13

Hi,
ok, pasted in the forum the code is harder to check, but we can see you have introduced a right content, and the issue may be that you have you set the links or the image path like this
index.php?Itemid=xxx

then this html won't work in any other place that your own site (you'll see the links and the image don't work on this moonsoft page either). The right way to set a link or reference that you want to use outside your website, like an email, is to set the full path
href="https://www.yoursite.com/path/index.php?Itemid=xx"

In fact there are no instructions at this page because there are no specific rules here, the content you set at the editor, will be sent in the email, unchanged. With the editor help, the code is likely to be correct, but a relative path won't work into an email or other site, not a problem of our extension or emails, this is how standard html links work. We may include this in a little text here for next version, in case it may help some other users not knowing this.

Setting all contents of all calculator messages at once is not an option of the extension, it's not a common use case that you have many calculators and that you want to update the same message for all of them. In fact, each calculator has different fields for pdf and email contents following our users requests along the years.

At this point our suggestion would be :
- change the urls of the image and links for the full path at one instance
- try it to confirm if the content is right
- then copy this content from this calculator to all others, if you don't want to do it manually or at the db records, you can launch a db script to update all of them at once, let's say you have the right content at calculator with ID= 5 , something like this would do the work:

update #__calcbuilder_utility set precalcprint=(select precalcprint from #__calcbuilder_utility where id=5) where id<>5

where #__ is your db prefix and 5 the calculator containing the right content.

Let us know if you need further help with this.
Regards
Silvia Martín
Moonsoft Team

Moonsoft support 2025-04-29 14:29:14

Hi,
also a couple of additional comments, please make a backup before launching mass changes at your db, and also please check your current email at your Moonsoft account, seems it's not valid anymore and we're receiving all forum emails returned back.

Thanks, best regards!
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-04-30 00:12:12

Thanks. I did move that domain onto a new host I forgot to update the email.

So I would just run that code in SQL?

Also, I did the previous version of this the exact same way, and it did work.

So not sure what has changed.

User TheFencepedia 2025-04-30 03:09:56

Just updated the code., linked directly to the pages and image on the frontend of the site.

Still stripping out all the HTM:L.

I need to fix this.

User TheFencepedia 2025-04-30 03:11:12

Here's the email output.

Moonsoft support 2025-04-30 09:21:34

Hi,
at the code html we still see the 'wrong/relative' urls, so you're getting non-accesible urls from the outside. For ex, the first one
a href="my-files/drawings"
should be

a href="https://www.yourdomain.com/my-files/drawings"

instead,. Maybe your editor is removing the absolute path when you save? If this is the problem, it may be just the editor configuration. For TinyMCE, if you go to the plugin configuration,select your administrator set and scroll down to URLs, where you can choose between relative and absolute. For other editors this kind of setting should be available as well. If you choose to use absolute urls and then update the links, you should see at the code the full paths as explained above. Then the email will be able to show the links and images as expected, and you can move forward to copy the content to other calculators. The sql query can be run just replacing the id of the calculator and your own joomla prefix.

If you still have problems to save your absolute urls, you can share a temp access at the private data section of this ticket. We'll take a look and let you know if we can find any other configuration or plugin affecting at your site.

Best regards
Silvia Martín
Moonsoft Team

User TheFencepedia 2025-04-30 19:11:37

I use JCE. I have pasted full urls, so it is probably altering them, as it does on every other component on my site.

I still don't see how your component would struggle to send this when it's on the same site though?

User TheFencepedia 2025-04-30 20:14:38

Hi again,

I checked on JCE, and they provided instructions to stop shortening URLS. https://www.joomlacontenteditor.net/support/forum/editor/102218-how-to-stop-jce-shortening-a-link

I did this. As you can see, it is no longer shortening URLs.

However, it is still stripping them out of the email that is being sent by yours system.

I still need you to resolve this.

User TheFencepedia 2025-04-30 20:16:38

I should note that this time, I UPLOADED the image that used to appear on the previous emails without any issues using the same method directly.

It's still not working. I don't know how else to upload an image to Joomla. Is there some magic word that I should say to get your component to recognize it first?

...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!