{{#if customer.inbox.orders}}
    <h2>{{lang 'forms.inbox.send_message'}}</h2>
    <form class="form" data-inbox-form action="{{urls.account.send_message}}" method="post">
        {{inject 'enterOrderNum' (lang 'forms.validate.account.inbox.order')}}
        {{inject 'enterSubject' (lang 'forms.validate.account.inbox.subject')}}
        {{inject 'enterMessage' (lang 'forms.validate.account.inbox.message')}}
        <div class="form-field">
            <label class="form-label" for="message_order_id">
                {{lang 'forms.inbox.order' }}
                <small>{{lang 'common.required' }}</small>
            </label>
            <select class="form-select" name="message_order_id" id="message_order_id">
                {{#each customer.inbox.orders}}
                    <option value="{{id}}">{{lang 'forms.inbox.order_display' id=id date=date total=amount.formatted}}</option>
                {{/each}}
            </select>
        </div>
        <div class="form-field" id="message_subject_field_id">
            <label class="form-label" for="message_subject">
                {{lang 'forms.inbox.subject' }}
                <small>{{lang 'common.required' }}</small>
            </label>
            <input aria-labelledby="message_subject_field_id" aria-live="polite" type="text" class="form-input" name="message_subject" id="message_subject">
        </div>
        <div class="form-field" id="message_content_field_id">
            <label class="form-label" for="message_content">
                {{lang 'forms.inbox.message' }}
                <small>{{lang 'common.required' }}</small>
            </label>

            <textarea aria-labelledby="message_content_field_id" aria-live="polite" class="form-input" name="message_content" id="message_content" rows="7" ></textarea>
        </div>
        <div class="form-actions">
            <input class="button button--primary" type="submit" value="{{lang 'forms.inbox.submit_value' }}">
            <input class="button" type="reset" value="{{lang 'forms.inbox.clear_value' }}">
        </div>
    </form>
{{else}}
    {{> components/common/alert/alert-info (lang 'forms.inbox.no_orders')}}
{{/if}}
