Skip to content

Commit

Permalink
chore: use provided MailChannels API
Browse files Browse the repository at this point in the history
  • Loading branch information
Yizack committed Aug 23, 2024
1 parent 2b1d0a6 commit 85a9b8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .config/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default defineNuxtConfig({
}
},
mail: {
apiKey: "",
from: "",
fromName: "",
host: "",
Expand Down
4 changes: 3 additions & 1 deletion server/utils/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const mailChannels = async (config: RuntimeConfig, message: EmailMessage): Promi
return await $fetch("https://api.mailchannels.net/tx/v1/send", {
method: "POST",
headers: {
"content-type": "application/json"
"X-API-Key": config.mail.apiKey,
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
personalizations: [{
Expand Down

0 comments on commit 85a9b8c

Please sign in to comment.