```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
- Unable to connect the git repo with appw...
I am trying to connect my existing repo with the appwrite functions. I have 2 functions in the same repo, and i was able to execute those through cli and its vi...
- Creating a function on appwrite Cloud.
I am trying to create a function on Appwrite cloud. I go to the console. I hit : Create function I choose DART-3.5 I put a name for my function : NameFunction...
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...