dawiph Posted September 17, 2018 Share Posted September 17, 2018 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 18, 2018 Share Posted September 18, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
dawiph Posted September 19, 2018 Author Share Posted September 19, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 19, 2018 Share Posted September 19, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
dawiph Posted September 19, 2018 Author Share Posted September 19, 2018 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 👍 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 20, 2018 Share Posted September 20, 2018 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! 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! 🕶️ 0 Quote Link to comment Share on other sites More sharing options...
dawiph Posted September 20, 2018 Author Share Posted September 20, 2018 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 😓 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 21, 2018 Share Posted September 21, 2018 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 < 0 Quote Link to comment Share on other sites More sharing options...
dawiph Posted September 21, 2018 Author Share Posted September 21, 2018 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 < 👍 good tip, thanks 0 Quote Link to comment Share on other sites More sharing options...
dawiph Posted September 21, 2018 Author Share Posted September 21, 2018 Edited the table and all works well. This should really work in the editor. I feel another feature request coming on 🙂 Here is the link for the other request to add the port variable https://requests.whmcs.com/topic/add-server-port-variable-to-email-template 0 Quote Link to comment Share on other sites More sharing options...
wildhoster Posted January 19 Share Posted January 19 Just got here on a Google search because my WHMCS setup is sending the wrong port number for logging into cPanel in the welcome email. (I didn't alter anything) The welcome email is sending: http://example.com:2082 when it should be http://example.com:2083. Why is this happening and how can I fix it? Thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.