@easybits.cloud/mailmask 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,15 +15,26 @@ import { MailMask } from "@easybits.cloud/mailmask";
|
|
|
15
15
|
|
|
16
16
|
const mm = new MailMask({ apiKey: "mm_live_..." });
|
|
17
17
|
|
|
18
|
-
//
|
|
18
|
+
// Get your domains
|
|
19
19
|
const domains = await mm.domains.list();
|
|
20
|
+
const domainId = domains[0].id;
|
|
20
21
|
|
|
21
|
-
// Create an alias
|
|
22
|
-
const alias = await mm.aliases.create({
|
|
23
|
-
domainId: "domain-id",
|
|
22
|
+
// Create an alias — emails to hello@yourdomain.com forward to your inbox
|
|
23
|
+
const alias = await mm.aliases.create(domainId, {
|
|
24
24
|
local: "hello",
|
|
25
25
|
destinations: ["you@example.com"],
|
|
26
26
|
});
|
|
27
|
+
|
|
28
|
+
// Send an email (routed through MailMask for high deliverability)
|
|
29
|
+
await mm.send.send(domainId, {
|
|
30
|
+
from: "hello",
|
|
31
|
+
to: "client@example.com",
|
|
32
|
+
subject: "Welcome!",
|
|
33
|
+
html: "<p>Thanks for signing up.</p>",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// List aliases for a domain
|
|
37
|
+
const aliases = await mm.aliases.list(domainId);
|
|
27
38
|
```
|
|
28
39
|
|
|
29
40
|
## Docs
|