Version 1 of 1 · · Current version

tags
#events

events-notify

Every message the event sends goes through this one rule, and here it's kept in the outbox (a Message object). In your own project, this is the one place to change for real notices (diesel.user.notify to the organizers, who are members) or email (diesel.user.sendEmail, once email is on).

$when events.notify (to: String, text: String) {
  n = dom.list(cls = "Message").total
  payload = dom.upsert(cls = "Message", entity = {id: "m${n + 1}", to: to, text: text, at: now()})
}
$when events.tellOrganizers (text: String) {
  payload = dom.list(cls = "Organizer").data map (o => events.notify(to = o.email, text = text))
}