attachEmailHandler function
Implementation
void attachEmailHandler(CloudflareWorkersEmailEvent handler) {
globalDartEmailHandler = allowInterop((interop.EmailMessage message,
interop.Environment env, interop.ExecutionContext ctx) {
return futureToPromise(Future(() async {
return handler(
emailMessageFromJsObject(message),
environmentFromJsObject(env),
executionContextFromJsObject(ctx),
);
}));
});
}