Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

updated path for email assets to absolute rather than relative paths

Type of Change

  • Bug fix

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Sep 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Sep 20, 2025 7:08pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 20, 2025 7:08pm

@waleedlatif1 waleedlatif1 merged commit 545e590 into staging Sep 20, 2025
4 of 5 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a critical bug in email template rendering by converting relative asset paths to absolute URLs across 9 email component files. The core issue was that email clients cannot resolve relative paths like /logo/reverse/text/medium.png when rendering HTML emails outside the web application context, causing logo images to appear broken in sent emails.

The fix systematically updates the fallback logo path in each email component from:

src={brand.logoUrl || '/logo/reverse/text/medium.png'}

to:

src={brand.logoUrl || `${baseUrl}/logo/reverse/text/medium.png`}

The baseUrl variable is consistently derived from env.NEXT_PUBLIC_APP_URL with a fallback to 'https://sim.ai' across all components. This ensures that when custom brand logos aren't configured, the fallback logo will display correctly in all email clients by providing a complete, absolute URL that email rendering engines can properly fetch.

This change integrates well with the existing email component architecture in the /sim/components/emails directory, where components like EmailFooter already use absolute URLs for assets through helper functions like getAssetUrl(). The fix maintains backward compatibility and only affects the fallback case when brand.logoUrl is not available, preserving existing brand customization functionality.

Confidence score: 5/5

  • This PR is extremely safe to merge with minimal risk of causing issues
  • Score reflects a straightforward bug fix with consistent implementation across all affected files
  • No files require special attention as the changes are uniform and well-tested

9 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

<Column style={{ textAlign: 'center' }}>
<Img
src={brand.logoUrl || '/logo/reverse/text/medium.png'}
src={brand.logoUrl || `${baseUrl}/logo/reverse/text/medium.png`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider using getAssetUrl() function consistently like the footer component does for social media icons, rather than manual ${baseUrl} concatenation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants