Skip to content

Commit 6039c22

Browse files
committed
wip
1 parent dccd93e commit 6039c22

19 files changed

+72
-27
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ node_modules/
4040

4141
.DS_Store
4242

43-
.env
43+
.env
44+
/examples/**/package-lock.json

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ Note:
6565
1. Get your **free API key** here: <https://app.templateless.com>
6666
1. There are more JavaScript examples in the [examples](examples) folder
6767

68+
```bash
69+
TEMPLATELESS_API_KEY=<Your API Key> \
70+
TEMPLATELESS_EMAIL_ADDRESS=<Your Own Email Address> \
71+
node examples/simple
72+
```
73+
6874
## 🤝 Contributing
6975

7076
- Contributions are more than welcome <3

dist/bundle.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/collection.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, SocialItem } from './components';
2-
import { Result } from '.';
32
export declare class Collection {
43
components: Component[];
54
constructor(builder: CollectionBuilder);
@@ -15,7 +14,7 @@ declare class CollectionBuilder {
1514
socials(data: SocialItem[]): this;
1615
text(text: string): this;
1716
viewInBrowser(text: string): this;
18-
build(): Result<Collection>;
17+
build(): Collection;
1918
private push;
2019
}
2120
export {};

dist/content.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, SocialItem } from './components';
2-
import { Result, Header, Footer } from '.';
2+
import { Header, Footer } from '.';
33
export declare enum Theme {
44
Unstyled = "UNSTYLED",
55
Simple = "SIMPLE"
@@ -29,7 +29,7 @@ declare class ContentBuilder {
2929
socials(data: SocialItem[]): this;
3030
text(text: string): this;
3131
viewInBrowser(text: string): this;
32-
build(): Result<Content>;
32+
build(): Content;
3333
private push;
3434
}
3535
export {};

dist/email.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EmailAddress, Result } from '.';
1+
import { EmailAddress } from '.';
22
interface EmailOptions {
33
deleteAfter?: number;
44
}
@@ -24,6 +24,6 @@ declare class EmailBuilder {
2424
subject(subject: string): this;
2525
content(content: Content): this;
2626
deleteAfter(seconds: number): this;
27-
build(): Result<Email>;
27+
build(): Email;
2828
}
2929
export {};

dist/errors.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ export declare class UnknownError extends Error {
2626
constructor();
2727
}
2828
export type TemplatelessError = UnauthorizedError | ForbiddenError | InvalidParameterError | BadRequestError | UnavailableError | UnknownError;
29-
export type Result<T> = T | TemplatelessError;

dist/templateless.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Email, Result, ObjectId } from '.';
1+
import { Email, ObjectId } from '.';
22
export interface EmailResponse {
33
emails: ObjectId[];
44
}
@@ -7,6 +7,6 @@ export declare class Templateless {
77
private _domain;
88
constructor(apiKey: string);
99
domain(domain: string): this;
10-
send(email: Email): Promise<Result<ObjectId[]>>;
11-
sendMany(emails: Email[]): Promise<Result<ObjectId[]>>;
10+
send(email: Email): Promise<ObjectId[]>;
11+
sendMany(emails: Email[]): Promise<ObjectId[]>;
1212
}

0 commit comments

Comments
 (0)