Jump to content

Email template wrong URL


Recommended Posts

I am having trouble with the URL that is used when clicking on a link generated in the Hosting Welcome email. The variable I am using is the $service_server_hostname. It displays the URL correctly as Control Panel URL: https://example.com:8090/, but on clicking on the link takes me to the <ipaddress of the server>:8082

This fails on cPanel and Cyberpanel in the same way. I would like it to take me the the server hostname and the correct port.

Also, the ports are different between control panels which means I cannot hard code the port.  Is there a variable for the server panel port I can pull in from the server settings?

 

many thanks

 

 

Link to comment
Share on other sites

isn't the email template coded to use the server IP by default?

Control Panel URL: <a href="http://{$service_server_ip}:2082/">

it sounds as though you've just changed the text used in the link, rather than the link itself.

On 17/09/2018 at 17:32, dawiph said:

Is there a variable for the server panel port I can pull in from the server settings?

I doubt it, you may be looking at a multiple option {if} statement in the template to determine the correct port based on the value of another variable - whether that's the server IP or product name etc.

Link to comment
Share on other sites

14 hours ago, brian! said:

isn't the email template coded to use the server IP by default?


Control Panel URL: <a href="http://{$service_server_ip}:2082/">

it sounds as though you've just changed the text used in the link, rather than the link itself.

I doubt it, you may be looking at a multiple option {if} statement in the template to determine the correct port based on the value of another variable - whether that's the server IP or product name etc.

It was a silly mistake. I dropped to text editor and then could see the problem. The href url was wrong as you said - thank you! 😀

With regards the port number having a variable, it seems like something that would often be needed for any mixed panel setup. The server setup page has the port number for each server, it seems an oversight not to include it as variable for email templates.

 

 

Link to comment
Share on other sites

1 hour ago, dawiph said:

With regards the port number having a variable, it seems like something that would often be needed for any mixed panel setup. The server setup page has the port number for each server, it seems an oversight not to include it as variable for email templates.

I suspect what WHMCS expect you to do is create a custom Welcome email template for each panel... and that way you can specify the correct appropriate port in each template and assign each product to use the correct email template.

the other way, as I suggested previously, would be to just use one generic welcome email and add conditions to its output... but in a multi-panel setup, that could get messy.

Link to comment
Share on other sites

3 hours ago, brian! said:

I suspect what WHMCS expect you to do is create a custom Welcome email template for each panel... and that way you can specify the correct appropriate port in each template and assign each product to use the correct email template.

the other way, as I suggested previously, would be to just use one generic welcome email and add conditions to its output... but in a multi-panel setup, that could get messy.

I'm going with the generic email and a condition. With only 2 panels it should be a simple bit of code. I've opened up a feature request as I think it's a small change that could make things a little easier for people in the future.

 

thanks for your help 👍

Link to comment
Share on other sites

20 hours ago, dawiph said:

I've opened up a feature request as I think it's a small change that could make things a little easier for people in the future.

be aware that feature requests will take years to be implemented - i'm not joking! waiting.gif

you might want to post a link to the request for others who read this thread in the future - because I just did a quick search for it and I couldn't see it! 🕶️

Link to comment
Share on other sites

Ah, I'm not too worried. I went back to plan A in the end and did as you suggested and setup email templates. The conditional statement was too long for the editor, even in text edit, upon saving it the end of the statement got chopped 🙄 I just have to remember what Server the client uses if I ever choose to send a Welcome email manually.

As for the feature request, I've tried to add it 3 times and it is not showing up. The post saves, but no post seems to be made. I gave up 😓

 

Link to comment
Share on other sites

22 hours ago, dawiph said:

Ah, I'm not too worried. I went back to plan A in the end and did as you suggested and setup email templates. The conditional statement was too long for the editor, even in text edit, upon saving it the end of the statement got chopped

if i'm doing any serious Smarty work in the email templates, it's often easier to edit the appropriate record in tblemailtemplates directly as that avoids WHMCS doing anything strange to the output - e.g converting < to &lt;

Link to comment
Share on other sites

47 minutes ago, brian! said:

if i'm doing any serious Smarty work in the email templates, it's often easier to edit the appropriate record in tblemailtemplates directly as that avoids WHMCS doing anything strange to the output - e.g converting < to &lt;

👍 good tip, thanks

Link to comment
Share on other sites

  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated