Skip to content
Playground(another site)

bynk.email.bad_params

Error An email on message handler does not take exactly one InboundEmail parameter.

An email on message handler takes the message as one InboundEmail parameter: inbound email delivers one message per call, so the handler is on message(mail: InboundEmail) -> Effect[EmailVerdict]. A parameter of another type, or none, or more than one, is refused. Import InboundEmail and EmailVerdict from bynk.cloudflare.

Example

service support from email("[email protected]") {
on message(mail: String) -> Effect[EmailVerdict] { // ✗ not an `InboundEmail`
Accept
}
}
service support from email("[email protected]") {
on message(mail: InboundEmail) -> Effect[EmailVerdict] { // ✓
Accept
}
}

In the Book

See also

  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.email.bad_params shows the same from the installed toolchain, without a network.