function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nirmal ChristopherNirmal Christopher 

Getting Site URL dynamically using Apex

I have developing apex class that will send an email with site URL, it's hard coded it's working our org, when I deploy the apex class in another org, It's sending the same URL as it's hard coded.

I need to send the URL dynamically depends on where it's installed.
Best Answer chosen by Nirmal Christopher
t.deepthi05t.deepthi05
 create a custom label, Then add the hardcoded value in the custom label refer the custom label in your class.
when u move it different organization change the custom label according to the oragnization url