[PR #827] [MERGED] feat: hide send mail UI when not configured #789

Closed
opened 2026-02-26 21:32:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827
Author: @dreamhunter2333
Created: 2/1/2026
Status: Merged
Merged: 2/1/2026
Merged by: @dreamhunter2333

Base: mainHead: feature/email


📝 Commits (1)

  • d948e8b feat: hide send mail UI when not configured

📊 Changes

4 files changed (+39 additions, -4 deletions)

View changed files

📝 frontend/src/store/index.js (+1 -0)
📝 frontend/src/views/Index.vue (+3 -3)
📝 worker/src/commom_api.ts (+2 -0)
📝 worker/src/common.ts (+33 -1)

📄 Description

User description

Summary

Hide send mail related UI elements when no send mail method is configured on the backend.

Changes

Backend

  • worker/src/common.ts - Add isSendMailEnabled(c, domain) and isAnySendMailEnabled(c) functions
  • worker/src/commom_api.ts - Return enableSendMail field in /open_api/settings

Frontend

  • frontend/src/store/index.js - Add enableSendMail state
  • frontend/src/views/Index.vue - Conditionally render send mail UI

Behavior

Configuration UI Behavior
No send mail configured Hide sendmail tab, sendbox tab, reply button
RESEND_TOKEN configured Show all send mail UI
SMTP_CONFIG configured Show all send mail UI
SEND_MAIL binding configured Show all send mail UI

Detection Logic

Checks per domain:

  1. RESEND_TOKEN or RESEND_TOKEN_{DOMAIN}
  2. SMTP_CONFIG[domain]
  3. SEND_MAIL binding

🤖 Generated with Claude Code


PR Type

Enhancement


Description

  • Added backend logic to detect send mail configuration per domain.

  • Updated frontend to conditionally render send mail UI elements.

  • Introduced isSendMailEnabled and isAnySendMailEnabled functions in backend.

  • Extended /open_api/settings endpoint to include enableSendMail field.


Diagram Walkthrough

flowchart LR
  Backend["Backend Logic"] -- "Add isSendMailEnabled & isAnySendMailEnabled" --> API["/open_api/settings"]
  API -- "Expose enableSendMail field" --> Frontend["Frontend State"]
  Frontend -- "Conditionally render send mail UI" --> UI["Send Mail UI"]

File Walkthrough

Relevant files
Enhancement
Index.vue
Conditional rendering of send mail UI in frontend               

frontend/src/views/Index.vue

  • Updated to conditionally render send mail UI elements.
  • Added checks for enableSendMail to display specific tabs and buttons.
+3/-3     
commom_api.ts
Extend settings API with send mail configuration                 

worker/src/commom_api.ts

  • Added enableSendMail field to /open_api/settings response.
  • Integrated isAnySendMailEnabled function for backend logic.
+2/-0     
common.ts
Add functions to check send mail configuration                     

worker/src/common.ts

  • Introduced isSendMailEnabled function to check domain-specific
    configuration.
  • Added isAnySendMailEnabled function to check global configuration.
+33/-1   
index.js
Add enableSendMail state to frontend store                             

frontend/src/store/index.js

  • Added enableSendMail state to global store.
+1/-0     


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 2/1/2026 **Status:** ✅ Merged **Merged:** 2/1/2026 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/email` --- ### 📝 Commits (1) - [`d948e8b`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/d948e8b2e2be5d0ddd38005838985d1027930b83) feat: hide send mail UI when not configured ### 📊 Changes **4 files changed** (+39 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/store/index.js` (+1 -0) 📝 `frontend/src/views/Index.vue` (+3 -3) 📝 `worker/src/commom_api.ts` (+2 -0) 📝 `worker/src/common.ts` (+33 -1) </details> ### 📄 Description ### **User description** ## Summary Hide send mail related UI elements when no send mail method is configured on the backend. ## Changes ### Backend - `worker/src/common.ts` - Add `isSendMailEnabled(c, domain)` and `isAnySendMailEnabled(c)` functions - `worker/src/commom_api.ts` - Return `enableSendMail` field in `/open_api/settings` ### Frontend - `frontend/src/store/index.js` - Add `enableSendMail` state - `frontend/src/views/Index.vue` - Conditionally render send mail UI ## Behavior | Configuration | UI Behavior | |---------------|-------------| | No send mail configured | Hide sendmail tab, sendbox tab, reply button | | RESEND_TOKEN configured | Show all send mail UI | | SMTP_CONFIG configured | Show all send mail UI | | SEND_MAIL binding configured | Show all send mail UI | ## Detection Logic Checks per domain: 1. `RESEND_TOKEN` or `RESEND_TOKEN_{DOMAIN}` 2. `SMTP_CONFIG[domain]` 3. `SEND_MAIL` binding 🤖 Generated with [Claude Code](https://claude.ai/code) ___ ### **PR Type** Enhancement ___ ### **Description** - Added backend logic to detect send mail configuration per domain. - Updated frontend to conditionally render send mail UI elements. - Introduced `isSendMailEnabled` and `isAnySendMailEnabled` functions in backend. - Extended `/open_api/settings` endpoint to include `enableSendMail` field. ___ ### Diagram Walkthrough ```mermaid flowchart LR Backend["Backend Logic"] -- "Add isSendMailEnabled & isAnySendMailEnabled" --> API["/open_api/settings"] API -- "Expose enableSendMail field" --> Frontend["Frontend State"] Frontend -- "Conditionally render send mail UI" --> UI["Send Mail UI"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>Index.vue</strong><dd><code>Conditional rendering of send mail UI in frontend</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/views/Index.vue <ul><li>Updated to conditionally render send mail UI elements.<br> <li> Added checks for <code>enableSendMail</code> to display specific tabs and buttons.</ul> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827/files#diff-9816bb6131d16919d3ca2c71fb0911d2cb73cc9a49d75394c6206ff15f1aa4d8">+3/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>commom_api.ts</strong><dd><code>Extend settings API with send mail configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/commom_api.ts <ul><li>Added <code>enableSendMail</code> field to <code>/open_api/settings</code> response.<br> <li> Integrated <code>isAnySendMailEnabled</code> function for backend logic.</ul> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827/files#diff-fe2dec25bee7d722fe8aa25b616c21bd12b8123e26469f5cac11c9164be783c3">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>common.ts</strong><dd><code>Add functions to check send mail configuration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/common.ts <ul><li>Introduced <code>isSendMailEnabled</code> function to check domain-specific <br>configuration.<br> <li> Added <code>isAnySendMailEnabled</code> function to check global configuration.</ul> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827/files#diff-fcc08fd5aa3c190d0d45c7e3dd208e5ee831d360b272fdd5869607cf472c5eb1">+33/-1</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.js</strong><dd><code>Add enableSendMail state to frontend store</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/store/index.js - Added `enableSendMail` state to global store. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/827/files#diff-0c36ce15651c51795b411359e8caaf5af7960c82674b4f2015b8dd5f480fde2c">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:32:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudflare_temp_email#789
No description provided.