@home.route('/send_to_other/<filename>/', methods=['GET', 'POST'])
@home.route('/send_to_other/<filename>/<mailto>/', methods=['GET', 'POST'])
@login_required
def send_to_other(filename=None, mailto=None):
    form = SendToColleagueForm()
    if ((request.method == 'POST') and (BTN_CANCEL in request.form)):
        return redirect(get_back_url())
    (current_document, eml_node) = reload_metadata()
    if form.validate_on_submit():
        colleague_name = form.data['colleague_name']
        email_address = form.data['email_address']
        eml_node = load_eml(filename=filename)
        dataset_node = eml_node.find_child(child_name=names.DATASET)
        title_node = dataset_node.find_child(names.TITLE)
        title = ''
        if title_node:
            title = title_node.content
        if (not title):
            flash('The data package requires a Title', 'error')
            return redirect(get_back_url())
        zipfile_path = zip_package(current_document, eml_node)
        (_, download_url) = save_as_ezeml_package_export(zipfile_path)
        if (not mailto):
            (mailto, mailto_html, mailto_raw) = send_to_other_email(colleague_name, email_address, title, download_url)
        else:
            mailto = None
            mailto_html = None
            mailto_raw = None
    eml_node = load_eml(filename=filename)
    title_node = eml_node.find_single_node_by_path([names.DATASET, names.TITLE])
    if ((not title_node) or (not title_node.content)):
        flash('The data package must have a Title before it can be sent.', 'error')
    set_current_page('send_to_other')
    if mailto:
        form.colleague_name.data = ''
        form.email_address.data = ''
        help = get_helps(['send_to_colleague_2'])
        return render_template('send_to_other_2.html', title='Send to Other', mailto=mailto, mailto_html=mailto_html, mailto_raw=mailto_raw, check_metadata_status=get_check_metadata_status(eml_node, current_document), form=form, help=help)
    else:
        help = get_helps(['send_to_colleague'])
        return render_template('send_to_other.html', title='Send to Other', check_metadata_status=get_check_metadata_status(eml_node, current_document), form=form, help=help)
@home.route('/send_to_other/<filename>/', methods=['GET', 'POST'])
@home.route('/send_to_other/<filename>/<mailto>/', methods=['GET', 'POST'])
@login_required
def send_to_other(filename=None, mailto=None):
    form = SendToColleagueForm()
    if ((request.method == 'POST') and (BTN_CANCEL in request.form)):
        return redirect(get_back_url())
    (current_document, eml_node) = reload_metadata()
    if form.validate_on_submit():
        colleague_name = form.data['colleague_name']
        email_address = form.data['email_address']
        eml_node = load_eml(filename=filename)
        dataset_node = eml_node.find_child(child_name=names.DATASET)
        title_node = dataset_node.find_child(names.TITLE)
        title = 
        if title_node:
            title = title_node.content
        if (not title):
            flash('The data package requires a Title', 'error')
            return redirect(get_back_url())
        zipfile_path = zip_package(current_document, eml_node)
        (_, download_url) = save_as_ezeml_package_export(zipfile_path)
        if (not mailto):
            (mailto, mailto_html, mailto_raw) = send_to_other_email(colleague_name, email_address, title, download_url)
        else:
            mailto = None
            mailto_html = None
            mailto_raw = None
    eml_node = load_eml(filename=filename)
    title_node = eml_node.find_single_node_by_path([names.DATASET, names.TITLE])
    if ((not title_node) or (not title_node.content)):
        flash('The data package must have a Title before it can be sent.', 'error')
    set_current_page('send_to_other')
    if mailto:
        form.colleague_name.data = 
        form.email_address.data = 
        help = get_helps(['send_to_colleague_2'])
        return render_template('send_to_other_2.html', title='Send to Other', mailto=mailto, mailto_html=mailto_html, mailto_raw=mailto_raw, check_metadata_status=get_check_metadata_status(eml_node, current_document), form=form, help=help)
    else:
        help = get_helps(['send_to_colleague'])
        return render_template('send_to_other.html', title='Send to Other', check_metadata_status=get_check_metadata_status(eml_node, current_document), form=form, help=help)