```js import {Client, ID, Messaging} from 'node-appwrite';
export default async ({req, res, log, error}) => { if (req.method !== 'GET') return res.json({message: 'Method not allowed'}, 405);
const client = new Client()
.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
.setKey(req.headers['x-appwrite-key']);
const messaging = new Messaging(client);
await messaging.createEmail({
topics: ['69781a8c0003xxxxxx'],
subject: 'Test',
content: '<h1>Test</h1>',
html: true,
messageId: ID.unique(),
});
return res.empty();
};
The execution gets an error: ```Execution timed out.``` but the email is sent correctly??
Im very much confused as to why the return res.empty() would fail??
Even after adjusting timeout from 15s to 30s it sends the message within the first 10s and the just stays at processing status until it times out
I even tried to use a different response (res.json(...)) and still not responding
Recommended threads
- Python TablesDB Rework
Hi, i starting to rework some older functions to TablesDB list_rows Method. I used list_documents with a resultset with worked fine. Now i tried to get all rows...
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast