Fix workspaceLogo in invite-email (#5865)
## Fixes wrong image url in email  ## Done - duplicates and adapt `getImageAbsoluteURIOrBase64` from `twenty-front` in `twenty-email` - send `SERVER_URL` to email builder
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
export const getImageAbsoluteURIOrBase64 = (
|
||||
imageUrl?: string | null,
|
||||
serverUrl?: string,
|
||||
) => {
|
||||
if (!imageUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (imageUrl?.startsWith('data:') || imageUrl?.startsWith('https:')) {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
return serverUrl?.endsWith('/')
|
||||
? `${serverUrl.substring(0, serverUrl.length - 1)}/files/${imageUrl}`
|
||||
: `${serverUrl || ''}/files/${imageUrl}`;
|
||||
};
|
||||
Reference in New Issue
Block a user