According to Daily Sabah:
While all forms of transportation have currently resumed, there are a number of new practices and regulations in place to be aware of. A HES code will now be required for all intercity travel. HES, which is short for Hayat Eve Sığar (Life Fits into Home) is a mobile application pioneered by the Ministry of Health that tracks the contraction of the COVID-19 virus and shares maps of health services and risk areas. While the app is easily downloadable onto a mobile phone, it is also easily obtainable through sending an SMS to the number 2023 by entering the letters HES, followed by your country code, passport number, birth date and the number of days you want to travel plus seven days, all separated with blank spaces. The same method can be applied by foreigners with residence permits as well as Turkish citizens.
It appears that you can either download an app or text a Turkish short phone number. Texting that number wouldn’t work outside of Turkey and the app shows an error if you try to use a foreign number:
Is there another option for people with a foreign phone number to obtain this code? I’m planning a trip to Turkey soon and would like to ensure I can obtain it in advance.