Skip to content

Commit a2d9f96

Browse files
xmokraycastbot
andauthored
Update MXroute extension - show domain verification key in "add domain" + catchall ux improvements (#25179)
* [MXroute] verification key in add domain + catchall ux * Update CHANGELOG.md --------- Co-authored-by: raycastbot <bot@raycast.com>
1 parent 36aa7b9 commit a2d9f96

File tree

7 files changed

+66
-14
lines changed

7 files changed

+66
-14
lines changed

extensions/mxroute/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# MXroute Changelog
22

3+
## [Domain Verification Key in Add + Catch All UX] - 2026-02-05
4+
5+
- _Domain Verification Key_ is shown in "Add New Domain"
6+
- Improve the "Advanced" view to include descriptions of _CatchAll Type_
7+
38
## [Add Email Account from EmptyView + Access DNS Info] - 2026-01-26
49

510
- Add "Add New Email Account" `Action` to `EmptyView`

extensions/mxroute/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/mxroute/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
}
139139
],
140140
"dependencies": {
141-
"@raycast/api": "^1.104.3",
141+
"@raycast/api": "^1.104.4",
142142
"@raycast/utils": "^2.2.2"
143143
},
144144
"devDependencies": {

extensions/mxroute/src/advanced.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export default function Advanced({ selectedDomainName }: { selectedDomainName: s
4141
},
4242
});
4343

44+
const TYPE_DESCRIPTIONS: Record<CatchAllType, string> = {
45+
fail: "Emails to non-existent addresses are bounced back to the sender with an error message.",
46+
blackhole: "Emails to non-existent addresses are silently deleted. The sender receives no notification.",
47+
address: "All emails to non-existent addresses are forwarded to a specific email address.",
48+
};
49+
4450
return !catchAll ? (
4551
<Detail isLoading={isLoading} markdown="Fetching Catch All Settings" />
4652
) : (
@@ -53,7 +59,10 @@ export default function Advanced({ selectedDomainName }: { selectedDomainName: s
5359
}
5460
>
5561
<Form.Description text={selectedDomainName} />
56-
<Form.Description title="Description" text={catchAll.description} />
62+
<Form.Description
63+
title="Description"
64+
text="Configure what happens when email is sent to non-existent addresses."
65+
/>
5766
<Form.Separator />
5867
<Form.Dropdown
5968
title="Catch-All Email"
@@ -65,13 +74,9 @@ export default function Advanced({ selectedDomainName }: { selectedDomainName: s
6574
<Form.Dropdown.Item title="Forward to Address" value={CatchAllType.Forward} />
6675
</Form.Dropdown>
6776
{values.type === CatchAllType.Forward && (
68-
<Form.TextField
69-
title="Forward to Address"
70-
placeholder="catchall@example.com"
71-
info="All emails to non-existent addresses are forwarded to a specific email address."
72-
{...itemProps.address}
73-
/>
77+
<Form.TextField title="Forward to Address" placeholder="catchall@example.com" {...itemProps.address} />
7478
)}
79+
<Form.Description text={TYPE_DESCRIPTIONS[values.type as CatchAllType]} />
7580
</Form>
7681
);
7782
}

extensions/mxroute/src/manage-domains.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ import {
1111
Toast,
1212
useNavigation,
1313
} from "@raycast/api";
14-
import { FormValidation, getFavicon, useCachedPromise, useForm } from "@raycast/utils";
14+
import { FormValidation, getFavicon, useCachedPromise, useCachedState, useForm, usePromise } from "@raycast/utils";
1515
import { mxroute } from "./mxroute";
1616
import EmailAccounts from "./email-accounts";
1717
import EmailForwarders from "./email-forwarders";
1818
import Advanced from "./advanced";
1919
import DNSInfo from "./dns-info";
20+
import { DomainVerificationKey } from "./types";
2021

2122
export default function ManageDomains() {
2223
const {
@@ -78,6 +79,11 @@ export default function ManageDomains() {
7879

7980
function AddDomain({ firstDomainName }: { firstDomainName: string }) {
8081
const { pop, push } = useNavigation();
82+
const [data, setData] = useCachedState<DomainVerificationKey>("domain-verification-key");
83+
const { isLoading } = usePromise(mxroute.getDomainVerificationKey, [], {
84+
onData: setData,
85+
execute: !data,
86+
});
8187
const { handleSubmit, itemProps } = useForm<{ domain: string }>({
8288
async onSubmit(values) {
8389
const { domain } = values;
@@ -111,9 +117,24 @@ function AddDomain({ firstDomainName }: { firstDomainName: string }) {
111117
});
112118
return (
113119
<Form
120+
isLoading={isLoading}
114121
actions={
115122
<ActionPanel>
116123
<Action.SubmitForm icon={Icon.Plus} title="Add Domain" onSubmit={handleSubmit} />
124+
{data && (
125+
<ActionPanel.Section>
126+
<Action.CopyToClipboard
127+
title="Copy Name to Clipboard"
128+
content={data.record.name}
129+
shortcut={Keyboard.Shortcut.Common.CopyName}
130+
/>
131+
<Action.CopyToClipboard
132+
title="Copy Value to Clipboard"
133+
content={data.record.value}
134+
shortcut={Keyboard.Shortcut.Common.Copy}
135+
/>
136+
</ActionPanel.Section>
137+
)}
117138
</ActionPanel>
118139
}
119140
>
@@ -123,6 +144,15 @@ function AddDomain({ firstDomainName }: { firstDomainName: string }) {
123144
info="Enter the domain without www (e.g., example.com)"
124145
{...itemProps.domain}
125146
/>
147+
<Form.Separator />
148+
{data && (
149+
<>
150+
<Form.Description text={data.description} />
151+
<Form.Description title="Type" text={data.record.type} />
152+
<Form.Description title="Name" text={data.record.name} />
153+
<Form.Description title="Value" text={data.record.value} />
154+
</>
155+
)}
126156
</Form>
127157
);
128158
}

extensions/mxroute/src/mxroute.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
EmailForwarder,
1010
CreateEmailForwarderRequest,
1111
CatchAll,
12+
DomainVerificationKey,
1213
} from "./types";
1314

1415
const { api_key, server, username } = getPreferenceValues<Preferences>();
@@ -25,12 +26,13 @@ const makeRequest = async <T>(endpoint: string, options?: RequestInit) => {
2526
body: options?.body,
2627
});
2728
if (response.headers.get("Content-Length") === "0") return undefined as T;
28-
const result = (await response.json()) as SuccessResponse<string[]> | ErrorResponse;
29+
const result = (await response.json()) as SuccessResponse<unknown> | ErrorResponse;
2930
if (!result.success) throw new Error(result.error.message);
3031
return result.data as T;
3132
};
3233

3334
export const mxroute = {
35+
getDomainVerificationKey: () => makeRequest<DomainVerificationKey>("verification-key"),
3436
domains: {
3537
create: (domain: string) => makeRequest("domains", { method: "POST", body: JSON.stringify({ domain }) }),
3638
get: (domain: string) => makeRequest<Domain>(`domains/${domain}`),

extensions/mxroute/src/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
export type DomainVerificationKey = {
2+
key: string;
3+
record: {
4+
type: "TXT";
5+
name: string;
6+
value: "domain-verified";
7+
};
8+
description: string;
9+
};
10+
111
export enum CatchAllType {
212
Reject = "fail",
313
DiscardSilently = "blackhole",

0 commit comments

Comments
 (0)