@app.route('/send-multiple/<draft_id>', methods=['DELETE'])
def multi_send_finish(draft_id):
 account = g.namespace.account
 if (account.discriminator == 'easaccount'):
  raise InputError('Multiple send is not supported for this provider.')
 valid_public_id(draft_id)
 draft = get_sending_draft(draft_id, g.namespace.id, g.db_session)
 if (not draft.is_sending):
  raise InputError('Invalid draft, not part of a multi-send transaction')
 if (not isinstance(account, GenericAccount)):
  try:
   with writable_connection_pool(account.id).get() as crispin_client:
    remote_delete_sent(crispin_client, account.id, draft.message_id_header, delete_multiple=True)
  except Exception:
   log_exception(sys.exc_info(), draft_public_id=draft.public_id)
 update_draft_on_send(account, draft, g.db_session)
 schedule_action('save_sent_email', draft, draft.namespace.id, g.db_session)
 return g.encoder.jsonify(draft)

@ app . route ( '/send-multiple/<draft_id>' , methods = [ 'DELETE' ] ) def multi_send_finish ( draft_id ) : account = g . namespace . account if ( account . discriminator == 'easaccount' ) : raise InputError ( 'Multiple send is not supported for this provider.' ) valid_public_id ( draft_id ) draft = get_sending_draft ( draft_id , g . namespace . id , g . db_session ) if ( not draft . is_sending ) : raise InputError ( 'Invalid draft, not part of a multi-send transaction' ) if ( not isinstance ( account , GenericAccount ) ) : try : with writable_connection_pool ( account . id ) . get ( ) as crispin_client : remote_delete_sent ( crispin_client , account . id , draft . message_id_header , delete_multiple = True ) except Exception : log_exception ( sys . exc_info ( ) , draft_public_id = draft . public_id ) update_draft_on_send ( account , draft , g . db_session ) schedule_action ( 'save_sent_email' , draft , draft . namespace . id , g . db_session ) return g . encoder . jsonify ( draft )
closes out a multi-send session by marking the sending draft as sent and moving it to the users sent folder .