Change summary. Script API methods that generate image URLs now honor the site Aliases JSON job-hostnames when invoked inside a job context. Previously, these methods ignored the job-hostnames entry for the site + locale and fell back to the default instance hostname (for example, *.demandware.net).
Please refer to the job hostname examples at https://help.salesforce.com/s/articleView?id=cc.b2c_hostname_aliases.htm&type=5.
"job-hostnames":
{
"default":"www.my-default-host.com",
"de":"www.my-de-host.com",
"en":"www.my-en-host.com"
}
End outcome and impact. Image generation operations that run outside a standard storefront request, such as catalog exports, automated messaging, and product feed generation, will use the correct customer-defined hostname. The operations will no longer fall back to default instance hostnames such as *.demandware.net.
Benefits for development and operations.
Applicable Script API methods within a job context.
MediaFile.getHttpsImageURL(): Generates a secure (HTTPS) URL for the media file.MediaFile.getAbsImageURL(): Generates an absolute URL for the media file.MediaFile.getHttpImageURL(): Generates a standard HTTP URL for the media file.URLUtils.httpsImage(...): Generates a secure DIS image URL for a product image.URLUtils.imageURL(...): Generates a DIS image URL for a product image.How to enable. This feature is controlled by a domain-specific feature toggle to avoid unexpected changes to public APIs for existing implementations.
To enable the feature for your environment, contact Salesforce Support and request enablement of the JobHostnameForImagingUrlGenerationEnabled feature toggle.
005390237

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.