Fix: Display SMTP/webhook notification delivery status in UI #15

Merged
Copilot merged 3 commits from copilot/fix-email-sending-issue into main 2025-11-05 16:48:36 -06:00
Copilot commented 2025-11-05 16:30:48 -06:00 (Migrated from github.com)

Users receive "Invitation created successfully" even when SMTP emails fail to send. Backend correctly returns notification_sent and notification_error fields, but frontend ignores them.

Changes

  • Check notification_sent field in invitation creation response
  • Display delivery-specific messages:
    • Success: "Invitation created and email sent successfully!"
    • Failure: "Invitation created, but email failed to send: {error}"
  • Apply 8s timeout for errors vs 5s for success (readability)
  • Handle SMTP and webhook methods identically

Example

// Before: Always shows success
const response = await invitationsApi.create(email, role, method);
setSuccess('Invitation created successfully');

// After: Check actual delivery status
const response = await invitationsApi.create(email, role, method);
if (response.data.notification_sent) {
  setSuccess(`Invitation created and ${methodName} sent successfully!`);
} else {
  setError(`Invitation created, but ${methodName} failed to send: ${response.data.notification_error}`);
}

Users now see specific SMTP errors (auth failures, misconfiguration, etc.) instead of silent failures.

Original prompt

This section details on the original issue you should resolve

<issue_title>Emails not sending via SMTP</issue_title>
<issue_description>The SMTP test shows that the email has been sent, however, when sending invite, no invite has been received

On the SMTP Mailbox Side, I do not see an email leaving the Mailbox.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Users receive "Invitation created successfully" even when SMTP emails fail to send. Backend correctly returns `notification_sent` and `notification_error` fields, but frontend ignores them. ## Changes - Check `notification_sent` field in invitation creation response - Display delivery-specific messages: - Success: "Invitation created and email sent successfully!" - Failure: "Invitation created, but email failed to send: {error}" - Apply 8s timeout for errors vs 5s for success (readability) - Handle SMTP and webhook methods identically ## Example ```javascript // Before: Always shows success const response = await invitationsApi.create(email, role, method); setSuccess('Invitation created successfully'); // After: Check actual delivery status const response = await invitationsApi.create(email, role, method); if (response.data.notification_sent) { setSuccess(`Invitation created and ${methodName} sent successfully!`); } else { setError(`Invitation created, but ${methodName} failed to send: ${response.data.notification_error}`); } ``` Users now see specific SMTP errors (auth failures, misconfiguration, etc.) instead of silent failures. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Emails not sending via SMTP</issue_title> > <issue_description>The SMTP test shows that the email has been sent, however, when sending invite, no invite has been received > > On the SMTP Mailbox Side, I do not see an email leaving the Mailbox.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes SluberskiHomeLab/noodlenook#14 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
SluberskiHomeLab (Migrated from github.com) approved these changes 2025-11-05 16:48:24 -06:00
Sign in to join this conversation.
No description provided.