feat(email): render shop logo inside WYSIWYG editor (cid swap)
This commit is contained in:
@@ -44,6 +44,9 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
|
||||
if (cached) {
|
||||
logoPreviewDataUrl = `data:${cached.contentType};base64,${Buffer.from(cached.bytes).toString("base64")}`;
|
||||
}
|
||||
} else if (settings.logoUrl) {
|
||||
// External HTTPS URL — fine to display directly in the editor.
|
||||
logoPreviewDataUrl = settings.logoUrl;
|
||||
}
|
||||
return { settings, logoPreviewDataUrl };
|
||||
};
|
||||
@@ -391,6 +394,7 @@ export default function SettingsRoute() {
|
||||
defaultValue={settings.emailBodyHtmlDe || DEFAULT_EMAIL_BODY_DE}
|
||||
variables={EMAIL_VARS}
|
||||
minHeight={220}
|
||||
logoDataUrl={logoPreviewDataUrl}
|
||||
/>
|
||||
|
||||
<Field
|
||||
@@ -405,6 +409,7 @@ export default function SettingsRoute() {
|
||||
defaultValue={settings.emailBodyHtmlEn || DEFAULT_EMAIL_BODY_EN}
|
||||
variables={EMAIL_VARS}
|
||||
minHeight={220}
|
||||
logoDataUrl={logoPreviewDataUrl}
|
||||
/>
|
||||
</s-stack>
|
||||
</s-section>
|
||||
|
||||
Reference in New Issue
Block a user