frappe / frappe/Letters

Fix: DocType Selector clears on update & resume_send API not found

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
16
Forks
8
Avg merge
6m
Merged PRs (30d)
1

Description

There are two issues we ran into when using the Letters app which we have identified and patched in our fork:

### 1. DocType selector in Settings loses state
When selecting a DocType (e.g. `Applicant`) in the Recipients tab that has multiple email fields, the `email_field` is not automatically selected. During this intermediate state, the `DoctypeTab.vue` component emits `null` to the main form because the config is incomplete. The main form's watcher then wipes out the `doctype` selection entirely before the user gets a chance to select the email field.

**Fix applied:**
Modified `emitConfig` in `DoctypeTab.vue` to emit a partial config object (`{ doctype: "...", email_field: "" }`) instead of `null`. This prevents the parent watcher from erasing the DocType while the user is actively selecting the email field.

### 2. `resume_send` API method not found
When a send is stalled and the user clicks the **Resume** button in the UI, it calls `letters.letters.api.resume_send`. However, this threw a method not found error because the `api/__init__.py` file was incorrectly exporting the internal helper `_resume_send` instead of the public `resume_send` function.

**Fix applied:**
Updated `letters/letters/api/__init__.py` to correctly import and export `resume_send` from `sending.py`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review DoctypeTab.vue and trace its emitConfig behavior through the parent form watcher, then inspect letters/letters/api/__init__.py and sending.py for the resume_send export. Verify that selecting a multi-email DocType preserves the DocType while choosing an email field, and that the Resume action resolves resume_send without a method-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.