Skip to content

Conversation

@Marfuen
Copy link
Contributor

@Marfuen Marfuen commented Dec 12, 2025

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes COMP-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@linear
Copy link

linear bot commented Dec 12, 2025

@vercel
Copy link

vercel bot commented Dec 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
app Ready Ready Preview Comment Dec 12, 2025 0:17am
portal Ready Ready Preview Comment Dec 12, 2025 0:17am

@cursor
Copy link

cursor bot commented Dec 12, 2025

PR Summary

Sends an email notification to organization contacts/admins when a new Trust Portal access request is submitted, using a new email template and email service method.

  • Email Templates:
    • Add apps/api/src/email/templates/access-request-notification.tsx for notifying orgs of new Trust Portal access requests (includes requester details, optional purpose/duration, and "Review Request" link).
  • Email Service:
    • Add sendAccessRequestNotification in TrustEmailService to send the new template with subject New Trust Portal Access Request - <org>.
  • Trust Access Flow:
    • Update createAccessRequest in TrustAccessService to notify the org upon request creation via sendAccessRequestNotificationToOrg.
    • Implement sendAccessRequestNotificationToOrg to determine recipients (Trust contactEmail or fallback to owner/admin members), build reviewUrl from BETTER_AUTH_URL and organizationId, and send emails to all recipients (using Promise.allSettled).

Written by Cursor Bugbot for commit efa0bcc. This will update automatically on new commits. Configure here.

@Marfuen Marfuen merged commit 8d2a811 into main Dec 12, 2025
7 of 9 checks passed
@Marfuen Marfuen deleted the tofik/CS-73-send-email-notification-to-org branch December 12, 2025 00:15
@graphite-app
Copy link

graphite-app bot commented Dec 12, 2025

Graphite Automations

"Auto-assign PRs to Author" took an action on this PR • (12/12/25)

1 assignee was added to this PR based on Mariano Fuentes's automation.

claudfuen pushed a commit that referenced this pull request Dec 12, 2025
# [1.70.0](v1.69.0...v1.70.0) (2025-12-12)

### Bug Fixes

* **auditor:** increase max poll duration to 30 minutes and add limit to scrape ([#1897](#1897)) ([764d605](764d605))

### Features

* **api:** add access request notification email functionality ([#1910](#1910)) ([8d2a811](8d2a811))
@claudfuen
Copy link
Contributor

🎉 This PR is included in version 1.70.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

}

// Construct review URL
const reviewUrl = `${process.env.BETTER_AUTH_URL}/${organizationId}/trust`;
Copy link

Choose a reason for hiding this comment

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

Bug: Unused requestId parameter prevents deep-linking to request

The requestId parameter is passed to sendAccessRequestNotificationToOrg but is never used in the function body. The reviewUrl on line 218 only includes the organization trust page (/${organizationId}/trust) without the specific request ID. This likely represents an incomplete implementation where the URL was meant to deep-link to the specific access request (e.g., /${organizationId}/trust/requests/${requestId}) so admins can review it directly, rather than landing on the general trust page and having to find the request themselves.

Fix in Cursor Fix in Web

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants