Skip to content

Commit e67a300

Browse files
committed
[Dashboard] Update support email to include wallet address (DASH-75) (#5055)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR refactors the `prepareEmailBody` function to accept a single `props` object instead of multiple parameters. It also updates the function to include `name` and `walletAddress`, while modifying the email body to reflect these changes. ### Detailed summary - Changed `prepareEmailBody` to accept a single `props` object. - Added `name` and `walletAddress` to the `props` object. - Updated the email body to include `# Name: ${name}` and `# Wallet address: ${walletAddress}`. - Modified the call to `prepareEmailBody` to pass a structured object instead of separate arguments. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 00a6a56 commit e67a300

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

apps/dashboard/src/app/(dashboard)/support/components/create-ticket.action.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ function prepareEmailTitle(
3636
return title;
3737
}
3838

39-
function prepareEmailBody(
40-
product: string,
41-
markdownInput: string,
42-
email: string,
43-
address: string,
44-
extraInfoInput: Record<string, string>,
45-
) {
39+
function prepareEmailBody(props: {
40+
product: string;
41+
markdownInput: string;
42+
email: string;
43+
name: string;
44+
extraInfoInput: Record<string, string>;
45+
walletAddress: string;
46+
}) {
47+
const { extraInfoInput, email, walletAddress, product, name, markdownInput } =
48+
props;
4649
// Update `markdown` to include the infos from the form
4750
const extraInfo = Object.keys(extraInfoInput)
4851
.filter((key) => key.startsWith("extraInfo_"))
@@ -54,7 +57,8 @@ function prepareEmailBody(
5457
})
5558
.join("");
5659
const markdown = `# Email: ${email}
57-
# Address: ${address}
60+
# Name: ${name}
61+
# Wallet address: ${walletAddress}
5862
# Product: ${product}
5963
${extraInfo}
6064
# Message:
@@ -110,13 +114,14 @@ export async function createTicketAction(
110114
keyVal[key] = formData.get(key)?.toString() || "";
111115
}
112116

113-
const markdown = prepareEmailBody(
117+
const markdown = prepareEmailBody({
114118
product,
115-
keyVal.markdown,
116-
account.data.email,
117-
account.data.name,
118-
keyVal,
119-
);
119+
markdownInput: keyVal.markdown,
120+
email: account.data.email,
121+
name: account.data.name,
122+
extraInfoInput: keyVal,
123+
walletAddress: activeAccount,
124+
});
120125

121126
const content = {
122127
type: "email",

0 commit comments

Comments
 (0)