Test 123

> > Quote level 2

> On Jul 6 2015, at 12:34 pm, spang@nylas.com <spang@nylas.com> wrote:
> Karim, Michael and I just discussed this. I'll send you a redwood docs diff later today to speed this along. Here's the summary for now.
> We agreed on:
> - add a param to the create/update APIs for events instead of creating a new API
> - no body customization for now
> - sending notifications defaults to `false`
> Differences from what we discussed:
> - call the parameter `notify_participants` instead of `send_notifications` (it's more explicit about who is getting notified)
> - only fail if event creation fails, not if the notifications fail to send*
> - to make failure happen less often, we should validate event participants' email addresses and reject requests with bad email addresses as invalid
> - on Google, use the `sendNotifications` parameter in the calendar API instead of sending out event notifications ourself, for consistency with expectations and increased reliability
> * We can document that we make a best-effort to deliver notifications, but they may not always succeed. This is a tiny edge case and it shouldn't come up very often, so we shouldn't cause clients to complicate their logic because of it.
> Please include the code for both create and update in your updated diff. It doesn't make sense to ship create only without update, and most of the code is there already.
> Samples:
> POST /n/<ns-id>/events?notify_participants=true -d '{ ... }'
> PUT /n/<ns-id>/events?notify_participants=true -d '{ ... }'
> Let's ship this and see what Lever thinks.

> > On Jul 6 2015, at 9:55 am, Karim Hamidou <karim@nylas.com> wrote:
> > Christine,
> > Here are my notes about the quick chat we had.
> > 1. We need an invite sending API. We could either:
> > - add a parameter to the event creation/update API to send emails to the participants
> > - or have a separate invite sending endpoint.
> > We chose to go with the former, because it's simpler.
> > 2. How would this work? When creating/updating/deleting an event, an API user can set the `send_notifications` parameter to `true`. In this case, the API will generate an event invite email and will send it to the participants.
> > Example: curl -X POST http://localhost:5555/n/namespace_id/events?send_notifications=true "{ title: 'test event', start: ... }"
> > 3. Error handling. Invite sending can fail in a variety of ways because we're sending emails. Because API users need to know if an message went through or not, the API behaves a bit like the synchronous sending API.
> > Here's what happens when a user creates an event with send_notifications=true:
> > 1. We create the event in the db
> > 2. We try sending emails
> > 3. If it failed, we delete the event from the db and return the SMTP error.
> > Of course API users can try re-sending the same invite as often as they wish.
> > 4. Limitations:
> > - it's not possible to define a custom body (though we could have define an ad-hoc `invite_body` field in the event JSON that could be used only for invite sending)
> > - no support for attached files
> > Did I forget anything?
> > k