Document and link in auto email is sitename not domain name

I’m trying to use this ({{frappe.utils.get_url_to_form(doc.doctype,}}) to get the url.

However the link generate with the sitename( the folder name like site.local ), the one in the file currentsite.txt


not the the domain name I set in the site configuration file site_config.json. This problem also happen in the links in auto emails.

 "db_name": "xxxxxxxxx",
 "db_password": "xxxxxxxxx",
 "db_type": "mariadb",
 "domains": [
  "domain name"
 "encryption_key": "xxxxxxxxx",
 "nginx_port": 80,
 "user_type_doctype_limit": {
  "employee_self_service": 10

Is there a way to change it with my actual domain name?
Thank you in advance for taking the time to look at my question.

Anyone have the same issue as I do?

Got any solution??

I’m not so sure about the domains part, but I believe u can specify as host_name and set it as your URL such as "host_name": ""

I do have this same issue! Did you figure it out?

Actualy, @HarryHan , the answer provided by @AMS_Fauzi solved the issue!

Thanks guys!