Self-host default images
Easy Email Pro registers its built-in image URLs with imageManager from easy-email-pro-core. Use the registry to find the images to host, replace their URLs, and check that every registered image uses an allowed origin.
Find the images to host​
Import the Easy Email Pro packages your application uses, including the kit or theme if applicable. Each package registers its defaults when it loads. Run this after those imports:
import { imageManager } from "easy-email-pro-core";
console.table(imageManager.list());
Each entry contains an id, a readable label, and the original defaultUrl. Use the original URLs to prepare copies and use the IDs as keys in your hosted URL map. An image shared by multiple blocks appears once.
Set the image URLs​
Pass your image ID-to-URL map as overrides before mounting the editor or rendering an email. The same option works for a single image or a full list. resolve is optional. Each call to configure() replaces the previous configuration.
import { imageManager } from "easy-email-pro-core";
import hostedUrls from "./hosted-image-urls.json";
imageManager.configure({ overrides: hostedUrls });
For example, hosted-image-urls.json can contain a single entry:
{
"core.social.facebook": "https://assets.example.com/email/facebook.png"
}
Use resolve only if your app computes URLs from the registered image metadata. An explicit overrides entry takes priority. If neither option provides a URL for an image, the original default is used.
Check the configured URLs​
const { ok, issues } = imageManager.audit({
allowedOrigins: ["https://assets.example.com"],
});
if (!ok) {
console.table(issues);
throw new Error("Some built-in images use unapproved origins");
}
The audit checks the final URL against the allowed HTTP(S) origins, including the scheme and port. Each result shows the image ID, original and final URLs, and whether the final URL came from an override, the resolver, or the default. images includes every audited entry and issues contains the entries outside the allowlist or without an absolute HTTP(S) URL.
Run this check after loading all the packages you plan to use. If your browser and server have separate entry points, apply the same configuration and run the check in both environments. The server only needs to load packages used for its rendering.
When the configuration applies​
New blocks and presets save the configured image URLs when you insert them. Existing image URLs in templates are preserved when you open, edit, or export them. Changing the configuration later applies to newly inserted defaults.
Standard social icons selected by network name use the current configuration when rendered, including in saved templates. Custom social icons use the saved image URL.
Use absolute URLs that recipients' email clients can reach. Free-plan branding is outside the image registry and the origin audit.
The audit covers registered default images. To verify a specific email, also check its final HTML for previously saved URLs, uploaded images, dynamic image URLs, and custom HTML. The audit does not fetch the files or check redirects.