@app.route('/send-multiple', methods=['POST'])
def multi_send_create():
 account = g.namespace.account
 if (account.discriminator == 'easaccount'):
  raise InputError('Multiple send is not supported for this provider.')
 data = request.get_json(force=True)
 draft = create_message_from_json(data, g.namespace, g.db_session, is_draft=False)
 validate_draft_recipients(draft)
 draft.mark_as_sending()
 g.db_session.add(draft)
 request.environ['log_context']['draft_public_id'] = draft.public_id
 return g.encoder.jsonify(draft)

@ app . route ( '/send-multiple' , methods = [ 'POST' ] ) def multi_send_create ( ) : account = g . namespace . account if ( account . discriminator == 'easaccount' ) : raise InputError ( 'Multiple send is not supported for this provider.' ) data = request . get_json ( force = True ) draft = create_message_from_json ( data , g . namespace , g . db_session , is_draft = False ) validate_draft_recipients ( draft ) draft . mark_as_sending ( ) g . db_session . add ( draft ) request . environ [ 'log_context' ] [ 'draft_public_id' ] = draft . public_id return g . encoder . jsonify ( draft )
initiates a multi-send session by creating a new multi-send draft .