-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnotif.js
26 lines (22 loc) · 1.09 KB
/
notif.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// const sdk = require('node-appwrite');
import dotenv from "dotenv";
dotenv.config();
import { Client, Messaging, ID } from "node-appwrite"
let clnt = new Client();
clnt
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject(process.env.PROJECT_ID_NOTIF) // Your project ID
.setKey(process.env.API_KEY_APPWRITE) // Your secret API key
// .setSelfSigned() // Use only/ on dev mode with a self-signed SSL cert
;
const messaging = new Messaging(clnt)
export const sendEmail = async () => {
const message = await messaging.createEmail(
ID.unique(), // Message ID, just a random UUID
'(URGENT) PROJECT CREATED @ AUTOLANDING AI', // subject
'Yo vinny, check out supabase and reach out to whoever the fuck just created the project. project id: ' + ID.unique(), //MESSg content
[], // topics (optional but keep it blank or else we gonna get error like that stripe api endpoint setup thingy)
['66ba6e0a0027bc14d367', '66ba6ccf000431b2aa31'], //user of email receiver from appwrite, both of us.
)
// console.log('mesg', message)
}