Skip to content

Commit e007707

Browse files
authored
Merge pull request #2859 from appwrite/fix/helpscout-metafields-consistency
Replace HelpScout customFields IDs with semantic metaFields
2 parents 2cf0cf8 + 909cf7e commit e007707

4 files changed

Lines changed: 19 additions & 35 deletions

File tree

src/lib/stores/feedback.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ function createFeedbackStore() {
105105
return feedback;
106106
});
107107
},
108-
// TODO: update growth server to accept `billingPlan`.
109-
// TODO: update growth server to accept `source` key to know the feedback source area.
110108
submitFeedback: async (
111109
subject: string,
112110
message: string,
@@ -122,18 +120,6 @@ function createFeedbackStore() {
122120
if (!VARS.GROWTH_ENDPOINT) return;
123121
trackEvent(Submit.FeedbackSubmit);
124122

125-
const customFields: Array<{ id: string; value: string | number }> = [
126-
{ id: '47364', value: currentPage }
127-
];
128-
129-
if (value) {
130-
customFields.push({ id: '40655', value });
131-
}
132-
133-
if (billingPlan) {
134-
customFields.push({ id: '56109', value: billingPlan });
135-
}
136-
137123
const response = await fetch(`${VARS.GROWTH_ENDPOINT}/feedback`, {
138124
method: 'POST',
139125
headers: {
@@ -143,9 +129,11 @@ function createFeedbackStore() {
143129
subject,
144130
message,
145131
email,
146-
customFields,
147132
firstname: (name || 'Unknown').slice(0, 40),
148133
metaFields: {
134+
currentPage,
135+
npsScore: value,
136+
billingPlan,
149137
source: get(feedback).source,
150138
orgId,
151139
projectId,

src/routes/(console)/organization-[organization]/settings/BAAModal.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,11 @@
6767
firstName: ($user?.name ?? '').slice(0, 40),
6868
message: `BAA request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`,
6969
tags: ['cloud'],
70-
customFields: [
71-
{ id: '41612', value: 'BAA' },
72-
{ id: '48493', value: $user?.name ?? '' },
73-
{ id: '48492', value: $organization?.$id ?? '' },
74-
{ id: '48490', value: $user?.$id ?? '' }
75-
],
7670
metaFields: {
71+
category: 'BAA',
72+
userName: $user?.name ?? '',
73+
orgId: $organization?.$id ?? '',
74+
userId: $user?.$id ?? '',
7775
employees: employees,
7876
country: country,
7977
role: role,

src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@
6868
firstName: ($user?.name ?? '').slice(0, 40),
6969
message: `SOC-2 request for ${$organization?.name ?? ''} (${$organization?.$id ?? ''})`,
7070
tags: ['cloud'],
71-
customFields: [
72-
{ id: '41612', value: 'SOC-2' },
73-
{ id: '48493', value: $user?.name ?? '' },
74-
{ id: '48492', value: $organization?.$id ?? '' },
75-
{ id: '48490', value: $user?.$id ?? '' }
76-
],
7771
metaFields: {
72+
category: 'SOC-2',
73+
userName: $user?.name ?? '',
74+
orgId: $organization?.$id ?? '',
75+
userId: $user?.$id ?? '',
7876
employees: employees,
7977
country: country,
8078
role: role,

src/routes/(console)/supportWizard.svelte

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@
136136
formData.append('message', $supportData.message);
137137
formData.append('tags[]', categoryTopicTag);
138138
formData.append(
139-
'customFields',
140-
JSON.stringify([
141-
{ id: '41612', value: $supportData.category },
142-
{ id: '48492', value: $organization?.$id ?? '' },
143-
{ id: '48491', value: $supportData?.project ?? '' },
144-
{ id: '56023', value: $supportData?.severity ?? '' },
145-
{ id: '56024', value: $organization?.billingPlanId ?? '' }
146-
])
139+
'metaFields',
140+
JSON.stringify({
141+
category: $supportData.category,
142+
orgId: $organization?.$id ?? '',
143+
projectId: $supportData?.project ?? '',
144+
severity: $supportData?.severity ?? '',
145+
billingPlan: $organization?.billingPlanId ?? ''
146+
})
147147
);
148148
if (files && files.length > 0) {
149149
formData.append('attachment', files[0]);

0 commit comments

Comments
 (0)