Upload email image
lnkdrp_upload_email_assetUploads one image for HTML email templates (a GIF, PNG, JPEG or WebP file) and stores it at a public address. An image up to 10 MB is kept exactly as uploaded, on every plan; over 5 MB the answer carries sizeNote (it may load slowly on phones). A bigger file is made smaller automatically, because big images make emails slow to open and more likely to be clipped or land in spam (at most 600px wide, then fewer colours and frames, or lower quality; a GIF stays animated), and the answer carries original { size, width, height } and resizedNote. A sourceUrl or an upload link's page takes a file up to 25 MB; dataBase64 up to 5 MB. One email shows at most 10 images, 20 MB in all; a template saved over that has its images made smaller until it fits. A PDF or other document is not an email image: unsupported_content_type with details.document true. lnkdrp_share_pdf uploads a PDF and makes its share link; lnkdrp_create_share_link makes a link to a document already in LinkDrop. A template carries a document's link through a {{link.url}} or {{link.}} slot. lnkdrp_whoami reports this workspace's limits (capabilities.emailImages). Every image refusal says the limit, why and what to do, with details.limits { perImageBytes, perEmailBytes, imagesPerEmail, workspaceImages }. An image attached in a chat fits neither source (it has no public address, and its base64 is far too long to copy faithfully): lnkdrp_create_email_asset_upload_link makes a one-time page where the person adds it from their browser. An HTML template shows only images uploaded to this workspace; any other source is refused when the template is saved (details.code image_not_an_asset). The source is exactly one of sourceUrl (an https address LinkDrop fetches itself) or dataBase64 (the file's bytes, a data: URL prefix allowed; up to 3 MB when this server talks to a hosted LinkDrop). The type is read from the file's bytes, not its name: SVG and other types are unsupported_content_type, a larger file, or one that cannot be made small enough, too_large, and a workspace keeps up to 200 images (validation with details.code assets_limit) and uploads up to 60 an hour and 300 a day, deleted ones included (rate_limited). A sourceUrl LinkDrop cannot fetch, or that answers an error, is validation with details.code source_unavailable. Returns the image's assetId, name, url, contentType, size, width, height and imgTag: a ready element with the address, alt text from name, width and a style that keeps it inside a narrow mail client, for a template body. Each call stores a new image, even of the same file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | A name for the image (1-120 characters); its alt text in imgTag. | |
| sourceUrl | No | An https address of the image, up to 25 MB; LinkDrop fetches it. | |
| dataBase64 | No | The image file's bytes as base64 (up to 5 MB, 3 MB to a hosted LinkDrop); a data:image/...;base64, prefix is accepted. |