Title: [Bug]: Duplicate-email recipients collapse onto one recipient when resolving PDF placeholder tags ({{signature, rN}})
Issue Description
When creating an envelope via POST /api/v2/envelope/create with an explicit recipients array where two or more recipients share the same email (but different signingOrder/name), every PDF placeholder tag ({{signature, rN}}, {{date, rN}}, etc.) resolves to the same recipient, regardless of which rN index the tag actually references. All fields for every tagged recipient end up bound to a single recipientId — in practice, whichever recipient row shares that email and got matched first.
This makes it impossible to build a single-document flow where one person needs to sign in more than one place/step (e.g. the same signer countersigning at steps 1, 4 and 6) using placeholder-tagged PDFs, without giving that signer distinct alias emails.
Steps to Reproduce
- Have a PDF with placeholder tags for at least 2 recipients, e.g.
{{signature, r1}}and{{signature, r2}}at different positions. POST /api/v2/envelope/create(multipart) with:(attach the tagged PDF as{ "type": "DOCUMENT", "title": "repro", "recipients": [ { "email": "[email protected]", "name": "A", "role": "SIGNER", "signingOrder": 1 }, { "email": "[email protected]", "name": "B", "role": "SIGNER", "signingOrder": 2 } ], "meta": { "signingOrder": "SEQUENTIAL" } }files)GET /api/v2/envelope/{id}and inspectfields[].recipientId.
Expected Behavior
Two fields are created: one bound to the recipient with signingOrder: 1, the other to signingOrder: 2
matching the r1/r2 tags, exactly as happens when the two recipients have distinct emails.
Current Behavior
Both fields are created bound to the same recipientId. The second recipient gets no fields at all.
Screenshots (optional)
No response
Operating System [e.g., Windows 10]
N/A (self-hosted Docker deployment, Linux host) reproduced purely via REST API, not a client-UI issue.
Browser [e.g., Chrome, Firefox]
N/A — reproduced via REST API.
Version [e.g., 2.13.0]
2.15.0
Please check the boxes that apply to this issue report.
- I have searched the existing issues to make sure this is not a duplicate.
- I have provided steps to reproduce the issue.
- I have included relevant environment information.
- I have included any relevant screenshots.
- I understand that this is a voluntary contribution and that there is no guarantee of resolution.
Source: documenso/documenso