Email send via new url

Hi,
We have hosted the Frappe hr in our local vm. We have changed our url from (for example : http://hrms.test.com:2001 to http://hrms.test.com:20)
But the email send from the application still directs to the old url. How to change it to the new url

1 Like

Hi,

Set this in your site_config.json:

“host_name”: “www.mysite.com

Thanks,

Divyesh Mangroliya

Hi @mangroliya ,
Can you explain me how this works?

In ERPNext, the host_name in the site_config.json file plays a crucial role in how links are generated in emails sent from the system. Here’s how it impacts those links:

  1. Base URL: The host_name specifies the base URL for your ERPNext site. This includes the protocol (http/https) and the domain name. For example, if host_name is set to "https://example.com", this will be the base URL used in links generated by ERPNext.

  2. Email Links: When ERPNext sends emails (like notifications, alerts, or invoices), it constructs links to resources (like the login page or specific records) using the host_name. If a user receives an email, clicking on these links will direct them to the correct location in the ERPNext application.

  3. Consistency: If the host_name is incorrectly set or missing, the links in the emails may point to the wrong domain or not function properly, leading to confusion for users or broken links.

  4. SSL Considerations: If your site uses SSL (HTTPS), ensure that the host_name reflects that. Otherwise, users may encounter security warnings when trying to access links.

  5. Multiple Sites: In a multi-site setup, each site’s site_config.json should have its own host_name configured correctly to ensure links in emails correspond to the appropriate site.

In summary, the host_name directly affects the accuracy and usability of links in ERPNext emails, ensuring users can access the correct resources seamlessly.

1 Like