-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
193 additions
and
94 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './check'; | ||
export * from './parse'; | ||
export * from './render'; | ||
export * from './resend'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { EmailCache } from '../types'; | ||
|
||
export async function replyToEmail(token: string, email: EmailCache, message: string): Promise<void> { | ||
await sendEmail(token, email.to, [email.from], `Re: ${email.subject}`, message); | ||
} | ||
|
||
export async function sendEmail(token: string, from: string, to: string[], subject: string, text: string): Promise<void> { | ||
await fetch('https://api.resend.com/emails', { | ||
method: 'POST', | ||
headers: { | ||
'Authorization': `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
from, | ||
to, | ||
subject, | ||
text, | ||
}), | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
export const TmaModeDescription: { [key: string]: string } = { | ||
export const tmaModeDescription: { [key: string]: string } = { | ||
test: 'Test an email address', | ||
white: 'Manage the white list', | ||
block: 'Manage the block list', | ||
}; | ||
|
||
export const TelegramCommands = [ | ||
export const telegramCommands = [ | ||
{ | ||
command: 'id', | ||
description: '/id - Get your chat ID', | ||
}, | ||
{ | ||
command: 'test', | ||
description: `/test - ${TmaModeDescription.test}`, | ||
description: `/test - ${tmaModeDescription.test}`, | ||
}, | ||
{ | ||
command: 'white', | ||
description: `/white - ${TmaModeDescription.white}`, | ||
description: `/white - ${tmaModeDescription.white}`, | ||
}, | ||
{ | ||
command: 'block', | ||
description: `/block - ${TmaModeDescription.block}`, | ||
description: `/block - ${tmaModeDescription.block}`, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters