Skip to content

Conversation

@Anmol1696
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds base64 encoding for email logos to work around email client image proxies that may not properly handle SVG or external images. The implementation fetches the logo from its URL, converts it to a base64 data URI, and embeds it directly in the email HTML.

Changes:

  • Added fetchLogoAsBase64 function that fetches images, validates size (max 50KB), and converts to base64 data URIs
  • Updated email sending logic to await base64 conversion of logo before generating email HTML

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@Anmol1696 I've opened a new pull request, #648, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 22, 2026

@Anmol1696 I've opened a new pull request, #649, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 8 commits January 22, 2026 13:16
- Add isUrlSafeToFetch validation function that checks:
  - Only allows HTTP/HTTPS protocols
  - Blocks localhost and local hostnames
  - Blocks private IPv4 ranges (10.x, 172.16-31.x, 192.168.x, 169.254.x, 127.x)
  - Blocks private IPv6 addresses (::1, fe80:, fc00:, fd00:)
- Integrate URL validation into fetchLogoAsBase64 before fetching
- Return undefined for unsafe URLs instead of attempting fetch
- Add warning logs for blocked URLs
- Fix unused error variables in catch blocks

Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Co-authored-by: Anmol1696 <10805402+Anmol1696@users.noreply.github.com>
Add SSRF protection to logo URL fetching
Add fetch timeout to prevent email sending hangs
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Anmol1696 Anmol1696 changed the title fix: add base64 logo into the email NOT_NEEDED: fix: add base64 logo into the email Jan 22, 2026
@Anmol1696 Anmol1696 marked this pull request as draft January 22, 2026 16:21
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