Since you should never hardcode content in apex, here are some alternatives places to store it:

1. Custom Settings
The main and current location to store data. Custom Settings are like custom objects used by the system. You can create custom fields and access them from most places (like flow).

Records are stored as data (not metadata).

2. Custom Metadata Types
Similar to Custom Settings but are mostly used for cross-instance deployment. This is because records are stored as metadata (not data). In addition, you don’t have as mention field data types available.

3. Custom Labels
Intended to handle multiple languages. Since they are not grouped together, it’s not often used for system-wide settings.

4. Custom Objects
All of the previous options require access to Setup. To provide easy access for your users, you can create a custom object instead.

5. Lightning Email Templates
Although intended to store emails only, they can be leveraged for most communication (like SMS messages).

Just remember that sometimes you still need to use Classic Email Templates (like for welcome and password reset emails in Experience Cloud).

6. Flow
Flow is not the preferred place for content, but it is an option. It’s better to use one of the above options and then access it from the flow rather than storing it directly in the flow itself.

The takeaway
With so many options, it’s easy to ensure content is widely available to internal and external users.

Category:
Salesforce