Skip to content

Commit fea370d

Browse files
committed
worker: stop polluting Resend dashboard with source as firstName
The firstName-as-source-tag hack was leaving 'website' / 'extension-setup' in the dashboard's First Name column, which is uglier than just leaving the field blank. We don't actually use signup-source for anything yet (YAGNI). If we need it later, do it properly via a Resend Segment. The route still accepts source for validation; we just don't pass it through to Resend anymore.
1 parent 6cab88a commit fea370d

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

extension/worker/src/__tests__/resend.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ describe('createResendClient', () => {
4242
expect.objectContaining({
4343
email: 'a@b.com',
4444
unsubscribed: false,
45-
firstName: 'website',
4645
}),
4746
);
4847
const createCall = mockContactsCreate.mock.calls[0][0];
4948
expect(createCall.segments).toBeUndefined();
49+
// We deliberately do NOT pass firstName — we'd be polluting the dashboard
50+
// with the source value otherwise (custom properties are paid).
51+
expect(createCall.firstName).toBeUndefined();
5052
});
5153

5254
it('addContact passes segmentId via segments array when configured', async () => {
@@ -65,7 +67,6 @@ describe('createResendClient', () => {
6567
expect(mockContactsCreate).toHaveBeenCalledWith(
6668
expect.objectContaining({
6769
email: 'a@b.com',
68-
firstName: 'extension-setup',
6970
segments: [{ id: 'seg_xyz' }],
7071
}),
7172
);

extension/worker/src/lib/resend.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ export function createResendClient(config: ResendClientConfig): ResendClient {
5656
throw new Error(getError.message);
5757
}
5858

59+
// We accept `source` from callers but don't pass it to Resend — custom
60+
// contact properties are a paid feature, and using firstName as a tag
61+
// pollutes the dashboard. If we ever need to segment by signup source,
62+
// do it via a proper Resend Segment.
63+
void source;
64+
5965
const { error: createError } = await resend.contacts.create({
6066
email,
6167
unsubscribed: false,
62-
// Tag contact source via firstName so it shows up in the dashboard
63-
// without needing custom contact properties (which are a paid feature
64-
// on Resend). TODO: swap to proper metadata/tags once available on
65-
// the free tier — note that this means dashboard 'first name' shows
66-
// 'website' or 'extension-setup', not a real name.
67-
firstName: source,
6868
...(config.segmentId
6969
? { segments: [{ id: config.segmentId }] }
7070
: {}),

0 commit comments

Comments
 (0)