[PR #443] [MERGED] feat: add mail id and url in webhook #578

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

📋 Pull Request Information

Original PR: https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443
Author: @dreamhunter2333
Created: 9/9/2024
Status: Merged
Merged: 9/9/2024
Merged by: @dreamhunter2333

Base: mainHead: feature/dev


📝 Commits (1)

  • cd469b9 feat: add mail id and url in webhook

📊 Changes

11 files changed (+87 additions, -12 deletions)

View changed files

📝 frontend/src/views/Index.vue (+45 -4)
📝 vitepress-docs/docs/en/cli.md (+2 -0)
📝 vitepress-docs/docs/zh/guide/cli/worker.md (+2 -0)
📝 worker/src/admin_api/mail_webhook_settings.ts (+5 -3)
📝 worker/src/common.ts (+9 -1)
📝 worker/src/email/index.ts (+1 -1)
📝 worker/src/mails_api/index.ts (+9 -0)
📝 worker/src/mails_api/webhook_settings.ts (+5 -3)
📝 worker/src/models/index.ts (+4 -0)
📝 worker/src/types.d.ts (+3 -0)
📝 worker/wrangler.toml.template (+2 -0)

📄 Description

User description

#429


PR Type

Enhancement, Documentation


Description

  • Added functionality to query mails by ID in the mailbox view.
  • Enhanced webhook payload to include mail ID and URL.
  • Added new API endpoint to fetch mail by ID.
  • Updated documentation to include FRONTEND_URL configuration.
  • Modified SQL queries to fetch mail ID along with raw email.

Changes walkthrough 📝

Relevant files
Enhancement
8 files
Index.vue
Add mail ID query functionality in the mailbox view           

frontend/src/views/Index.vue

  • Added useRoute to handle route changes.
  • Introduced mailIdQuery and showMailIdQuery for querying mails by ID.
  • Added a new input field and button for querying mails by ID.
  • Updated fetchMailData to handle mail ID queries.
  • +45/-4   
    mail_webhook_settings.ts
    Include mail ID and URL in webhook payload                             

    worker/src/admin_api/mail_webhook_settings.ts

  • Included mail ID and URL in the webhook payload.
  • Modified SQL query to fetch mail ID along with raw email.
  • +5/-3     
    common.ts
    Enhance webhook payload with mail ID and URL                         

    worker/src/common.ts

  • Added logging for webhook sending.
  • Included mail ID and URL in the webhook payload.
  • Modified triggerWebhook to fetch mail ID based on address and message
    ID.
  • +9/-1     
    index.ts
    Pass message ID to `triggerWebhook` function                         

    worker/src/email/index.ts

    • Updated triggerWebhook call to include message_id.
    +1/-1     
    index.ts
    Add API endpoint to fetch mail by ID                                         

    worker/src/mails_api/index.ts

    • Added new API endpoint to fetch mail by ID.
    +9/-0     
    webhook_settings.ts
    Enhance webhook settings with mail ID and URL                       

    worker/src/mails_api/webhook_settings.ts

  • Included mail ID and URL in the webhook payload.
  • Modified SQL query to fetch mail ID along with raw email.
  • +5/-3     
    index.ts
    Extend `WebhookMail` type with ID and URL                               

    worker/src/models/index.ts

  • Added id and url fields to WebhookMail type.
  • Updated WebhookSettings body template to include id and url.
  • +4/-0     
    types.d.ts
    Add `FRONTEND_URL` to environment bindings                             

    worker/src/types.d.ts

    • Added FRONTEND_URL to Bindings type.
    +3/-0     
    Documentation
    2 files
    cli.md
    Document `FRONTEND_URL` configuration in CLI docs               

    vitepress-docs/docs/en/cli.md

    • Documented FRONTEND_URL configuration.
    +2/-0     
    worker.md
    Document `FRONTEND_URL` configuration in CLI docs (Chinese)

    vitepress-docs/docs/zh/guide/cli/worker.md

    • Documented FRONTEND_URL configuration in Chinese.
    +2/-0     
    Configuration changes
    1 files
    wrangler.toml.template
    Add `FRONTEND_URL` to wrangler template                                   

    worker/wrangler.toml.template

    • Added FRONTEND_URL configuration.
    +2/-0     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions


    🔄 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/443 **Author:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Created:** 9/9/2024 **Status:** ✅ Merged **Merged:** 9/9/2024 **Merged by:** [@dreamhunter2333](https://github.com/dreamhunter2333) **Base:** `main` ← **Head:** `feature/dev` --- ### 📝 Commits (1) - [`cd469b9`](https://github.com/dreamhunter2333/cloudflare_temp_email/commit/cd469b99fea3b3c92f677aa34b2ed0be5db1c40f) feat: add mail id and url in webhook ### 📊 Changes **11 files changed** (+87 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/views/Index.vue` (+45 -4) 📝 `vitepress-docs/docs/en/cli.md` (+2 -0) 📝 `vitepress-docs/docs/zh/guide/cli/worker.md` (+2 -0) 📝 `worker/src/admin_api/mail_webhook_settings.ts` (+5 -3) 📝 `worker/src/common.ts` (+9 -1) 📝 `worker/src/email/index.ts` (+1 -1) 📝 `worker/src/mails_api/index.ts` (+9 -0) 📝 `worker/src/mails_api/webhook_settings.ts` (+5 -3) 📝 `worker/src/models/index.ts` (+4 -0) 📝 `worker/src/types.d.ts` (+3 -0) 📝 `worker/wrangler.toml.template` (+2 -0) </details> ### 📄 Description ### **User description** #429 ___ ### **PR Type** Enhancement, Documentation ___ ### **Description** - Added functionality to query mails by ID in the mailbox view. - Enhanced webhook payload to include mail ID and URL. - Added new API endpoint to fetch mail by ID. - Updated documentation to include `FRONTEND_URL` configuration. - Modified SQL queries to fetch mail ID along with raw email. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8 files</summary><table> <tr> <td> <details> <summary><strong>Index.vue</strong><dd><code>Add mail ID query functionality in the mailbox view</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> frontend/src/views/Index.vue <li>Added <code>useRoute</code> to handle route changes.<br> <li> Introduced <code>mailIdQuery</code> and <code>showMailIdQuery</code> for querying mails by ID.<br> <li> Added a new input field and button for querying mails by ID.<br> <li> Updated <code>fetchMailData</code> to handle mail ID queries.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-9816bb6131d16919d3ca2c71fb0911d2cb73cc9a49d75394c6206ff15f1aa4d8">+45/-4</a>&nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>mail_webhook_settings.ts</strong><dd><code>Include mail ID and URL in webhook payload</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/admin_api/mail_webhook_settings.ts <li>Included mail ID and URL in the webhook payload.<br> <li> Modified SQL query to fetch mail ID along with raw email.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-a8888cea638671df084f06f14c82a84294903585f3a218161847b0a96d044821">+5/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>common.ts</strong><dd><code>Enhance webhook payload with mail ID and URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/common.ts <li>Added logging for webhook sending.<br> <li> Included mail ID and URL in the webhook payload.<br> <li> Modified <code>triggerWebhook</code> to fetch mail ID based on address and message <br>ID.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-fcc08fd5aa3c190d0d45c7e3dd208e5ee831d360b272fdd5869607cf472c5eb1">+9/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.ts</strong><dd><code>Pass message ID to `triggerWebhook` function</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/email/index.ts - Updated `triggerWebhook` call to include `message_id`. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-da1768152a73f37b0a0780d578569f84c3d4bb946294e3a81fb0271302e6d816">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.ts</strong><dd><code>Add API endpoint to fetch mail by ID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/mails_api/index.ts - Added new API endpoint to fetch mail by ID. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-83710df6a60b2b512e134f32ad9890ab9a255040f6019f0d5603f72f4561cea4">+9/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>webhook_settings.ts</strong><dd><code>Enhance webhook settings with mail ID and URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/mails_api/webhook_settings.ts <li>Included mail ID and URL in the webhook payload.<br> <li> Modified SQL query to fetch mail ID along with raw email.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-0c4fdb3ef2a70f77455a6458c649932abb800e668143eb85d12c95ef911bfb37">+5/-3</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>index.ts</strong><dd><code>Extend `WebhookMail` type with ID and URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/models/index.ts <li>Added <code>id</code> and <code>url</code> fields to <code>WebhookMail</code> type.<br> <li> Updated <code>WebhookSettings</code> body template to include <code>id</code> and <code>url</code>.<br> </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-430bcc4ffa98738e7419c774a53ba2ce8b5127a36b3741e89bf36b95a56f02bc">+4/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>types.d.ts</strong><dd><code>Add `FRONTEND_URL` to environment bindings</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/src/types.d.ts - Added `FRONTEND_URL` to `Bindings` type. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-583fb024d5c9d1efac71bbea788d8379e5e8fc2f0bb1696a9863c6f6cac54bee">+3/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>2 files</summary><table> <tr> <td> <details> <summary><strong>cli.md</strong><dd><code>Document `FRONTEND_URL` configuration in CLI docs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> vitepress-docs/docs/en/cli.md - Documented `FRONTEND_URL` configuration. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-3f8f72a691fa19c8581621e91cf67ad28855af7a57e58513f6563cf4c8886e5f">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>worker.md</strong><dd><code>Document `FRONTEND_URL` configuration in CLI docs (Chinese)</code></dd></summary> <hr> vitepress-docs/docs/zh/guide/cli/worker.md - Documented `FRONTEND_URL` configuration in Chinese. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-f760a2ec5dad4b6bda0bd4a9325274567778add8cb984e73650dbaaf680c9178">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td> <details> <summary><strong>wrangler.toml.template</strong><dd><code>Add `FRONTEND_URL` to wrangler template</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> worker/wrangler.toml.template - Added `FRONTEND_URL` configuration. </details> </td> <td><a href="https://github.com/dreamhunter2333/cloudflare_temp_email/pull/443/files#diff-743273da72481b71fbeb1dddfd294be9249554eef65691dfc9bcfa9f0fd971fb">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
    kerem 2026-02-26 21:31:52 +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#578
    No description provided.