Image libraries
Content & assetsImage libraries
Add your own image sources to the editor: an Amazon S3 bucket, or your own media library.
The asset dialog has tabs per source. Pass s3 to add an Amazon S3 tab for your bucket (see Amazon S3), or open your own library from image and GIF blocks, as below.
Your own library
To open your own media library instead of the built-in one, register Unlayer's selectImage callback. "Open Library" on an image or GIF block then calls it. Call done with the chosen image, with { error }, or with no url to leave the image as it was.
tsx
<EmailEditor
token="pk_live_…"
onReady={(editor) => {
editor.registerCallback("selectImage", (data, done) => {
// data.kind is "image" or "gif"; openMyLibrary is your own picker
openMyLibrary(data.kind).then((picked) => done({ url: picked.url, alt: picked.alt }));
});
}}
/>For buckets and upload handlers, see custom file storage; for stock photos, see stock images.