Skip to content

Commit 4a12bc9

Browse files
committed
Refactor custom email handling in send-signature-request to use nested object structure for better clarity and update label for custom email title
1 parent 02b1a61 commit 4a12bc9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

components/lumin_pdf/actions/send-signature-request/send-signature-request.mjs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default {
8888
},
8989
customEmailTitle: {
9090
type: "string",
91-
label: "Title",
91+
label: "Custom Email Title",
9292
description: "The title of the email.",
9393
optional: true,
9494
},
@@ -173,11 +173,9 @@ export default {
173173
if (this.expiresAt) formData.append("expires_at", Date.parse(this.expiresAt));
174174
if (this.useTextTags) formData.append("use_text_tags", `${this.useTextTags}`);
175175
if (this.signingType) formData.append("signing_type", this.signingType);
176-
const customEmail = {};
177-
if (this.senderEmail) customEmail.sender_email = this.senderEmail;
178-
if (this.subject) customEmail.subject_name = this.subject;
179-
if (this.customEmailTitle) customEmail.title = this.customEmailTitle;
180-
if (Object.keys(customEmail).length > 0) formData.append("custom_email", JSON.stringify(customEmail));
176+
if (this.senderEmail) formData.append("custom_email[sender_email]", this.senderEmail);
177+
if (this.senderEmail) formData.append("custom_email[subject_name]", this.subject);
178+
if (this.senderEmail) formData.append("custom_email[title]", this.customEmailTitle);
181179

182180
const response = await this.luminPdf.sendSignatureRequest({
183181
$,

0 commit comments

Comments
 (0)