# You must use a tab-size of 4 spaces to edit this file.
---
zenario__email_template_manager:
    panels:
        email_templates: 
            title: Email Templates 
            notice:
                show: false
                type: warning
                message: ''
        
            item:
                css_class: zenario_email_template_panel
        
            db_items:
                table: |
                    [[DB_PREFIX]]email_templates as T
                    LEFT JOIN [[DB_PREFIX]]modules as M
                        ON T.module_class_name = M.class_name
                id_column: T.code
            default_sort_column: template_name
            label_format_for_picked_items: '[[template_name]] (ID[[layout_id]])'
            no_items_message: >
                There are no email templates. Most modules that send emails will
                create email templates when they are installed.
            refiners:
                email_templates_using_image:
                    table_join: |
                        INNER JOIN [[DB_PREFIX]]inline_images AS ii
                           ON ii.foreign_key_to = 'email_template'
                          AND ii.foreign_key_id = T.id
                          AND ii.image_id = [[REFINER_ID]]
            columns:
                layout_id:
                    title: ID
                    format: id
                    db_column: T.id
                    searchable: true
                    always_show: true
                    width: xxsmall
                
                template_name:
                    title: Email template name
                    db_column: T.template_name
                    searchable: true
                    always_show: true
                    width: large
                code:
                    title: Template code
                    db_column: T.code
                    searchable: true
                    show_by_default: false
                    width: large
                subject:
                    title: Subject
                    db_column: T.subject
                    searchable: true
                    always_show: true
                    width: large
                last_sent:
                    title: Last sent
                    db_column: T.last_sent
                    always_show: true
                    format: datetime
                    empty_value: Never used
                    width: small
                date_created:
                    title: Created
                    db_column: T.date_created
                    show_by_default: false
                    format: datetime
                    width: small
                date_modified:
                    title: Last edited
                    db_column: "IFNULL(date_modified,'---')"
                    show_by_default: false
                    format: datetime
                    width: small
                body_extract:
                    title: Body extract
                    db_column: T.body
                    width: xxlarge
                    show_by_default: true
                debug_override:
                    db_column: T.debug_override
                    format: yes_or_no
                    
            collection_buttons:
                create_template:
                    label: Create an email template
                    priv: _PRIV_MANAGE_EMAIL_TEMPLATE
                    css_class: zenario_create_a_new
                    hide_on_filter: true
                    admin_box:
                        path: zenario_email_template
                settings_dropdown:
                    css_class: organizer_settings_dropdown
                    hide_when_children_are_not_visible: true
                    label: ⚙
                test:
                    parent: settings_dropdown
                    priv: _PRIV_EDIT_SITE_SETTING
                    hide_in_select_mode: true
                    label: Email settings
                    hide_in_select_mode: "1"
                    admin_box:
                        path: site_settings
                        key:
                            id: email
            item_buttons:
                edit_template:
                    label: Edit email template
                    multiple_select: false
                    admin_box:
                        path: zenario_email_template
                view_dropdown:
                    label: View
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                view_log:
                    parent: view_dropdown
                    priv: _PRIV_VIEW_USER
                    label: Log of sent emails
                    record_count: sent_email_count
                    link:
                        path: zenario__email_template_manager/panels/email_log
                        branch: true
                        refiner: email_template
                action_dropdown:
                    label: Actions
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                test_send_template:
                    parent: action_dropdown
                    hide_in_select_mode: true
                    label: Send test email
                    ajax:
                        confirm:
                            message: Send a test email to [[admin_email_address]]?
                            button_message: Send
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            action: test_send_template
                duplicate_template:
                    parent: action_dropdown
                    priv: _PRIV_MANAGE_EMAIL_TEMPLATE
                    label: Duplicate
                    multiple_select: false
                    admin_box:
                        path: zenario_email_template
                        key:
                            duplicate: "1"
                delete_template:
                    priv: _PRIV_MANAGE_EMAIL_TEMPLATE
                    hide_in_select_mode: true
                    label: Delete
                    multiple_select: true
                    
                    disabled_if_for_any_selected_items: >
                        item.protected
                    disabled_tooltip: >
                        You cannot delete email templates installed by a module that is running.
                    
                    ajax:
                        confirm:
                            message: Are you sure you wish to delete the selected email template?
                            multiple_select_message: >
                                Are you sure you wish to delete the selected email
                                templates?
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            action: delete_template
            inline_buttons:
                debug_override:
                    visible_if: |
                        zenario.engToBoolean(item.debug_override)
                    css_class: zenario_ib_warning
                    admin_box:
                        path: zenario_email_template
                    tooltip: |
                        Debug mode enabled. Emails sent using this template will be
                        rerouted to the debug email address.