# You must use a tab-size of 4 spaces to edit this file.
---
site_settings:
    setting_group: email
    title: Editing email and newsletter settings
    tabs:
        email:
            label: Email
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
                on: false
            fields:
                description:
                    full_width: true
                    snippet:
                        html: |
                            This tab contains default settings for emails sent by your site, such as form-driven enquiries, and newsletters.
                data_protection_link:
                    snippet:
                        html: ''
                email_address_system:
                    label: 'Support email address:'
                    type: text
                    readonly: true
                    note_below: |
                        Any errors that occur on the site will be sent to this address.
                        This will have been set at installation time in your <code>zenario_siteconfig.php</code> file. To change this, editing the <code>EMAIL_ADDRESS_GLOBAL_SUPPORT</code> definition.
                email_address_from:
                    site_setting:
                        name: email_address_from
                    label: '"From" email address:'
                    type: text
                    value: yourname@zenar.io
                    note_below: |
                        Email address which all server-generated emails should appear to come "from".
                        You can use a real email account to catch undeliverable message reports, but note that your email system administrator may need to do things to allow you to send email from this domain, such as adding SPF and DKIM records.
                    validation:
                        required: 'Please enter a "From" email address.'
                        email: 'Please ensure this "From" email address is in a valid format.'
                email_name_from:
                    site_setting:
                        name: email_name_from
                    label: '"From" name:'
                    type: text
                    value: Zenario website
                    note_below: |
                        A name associated with the &quot;From&quot; email address.
                    validation:
                        required: Please enter a "From" sending name.
        template:
            label: Standard email template
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
                on: false
            fields:
                standard_email_template:
                    site_setting:
                        name: standard_email_template
                        advanced_inline_styles: true
                    label: 'Standard email template:'
                    type: editor
                    editor_type: full_featured
                    tall_as_possible: true
                    dont_trim: true
                    editor_options:
                        convert_urls: false
                        relative_urls: false
                    style: |
                        width: 100%;
                    insert_image_button:
                        pick_items:
                            path: 'zenario__library/panels/image_library'
                            target_path: 'zenario__library/panels/image_library'
                            min_path: 'zenario__library/panels/image_library'
                            max_path: 'zenario__library/panels/image_library'
                            disallow_refiners_looping_on_min_path: true
                    value: |
                        <table style="table-layout: auto; background: #EFEFEF;" border="0" width="100%" cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td style="vertical-align: top;">
                                        <table style="table-layout: auto; margin: 30px auto; border: 1px solid #000000;" border="0" width="620" cellspacing="0" cellpadding="0" align="center">
                                            <tbody>
                                                <tr>
                                                    <td style="background: #FFFFFF; vertical-align: top;">
                                                        <table style="table-layout: auto;" border="0" width="100%" cellspacing="0" cellpadding="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td style="padding: 35px 0; border-bottom: 3px solid #000000; text-align: center;">Company Logo</td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="font-family: Arial, Helvetica; padding: 0px 20px 0px; font-size: 14px; line-height: 22px; color: #000000;">
                                                                        <p>&nbsp;</p>
                                                                        [[email_body_content]]
                                                                        <p>&nbsp;</p>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="padding: 0px;">
                                                                        <table style="font-family: Tahoma, Geneva, sans-serif; table-layout: auto;" border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#000000">
                                                                            <tbody>
                                                                                <tr>
                                                                                    <td>&nbsp;</td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td><br>
                                                                                        <p style="text-align: center; color: #fff; font-size: 13px; line-height: 18px;">
                                                                                            &copy; Your company<br>
                                                                                            <span style="font-size: 11px;">Contact details<br></span>
                                                                                        </p>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr>
                                                                                    <td style="color: #3c3c3b;">&nbsp;.</td>
                                                                                </tr>
                                                                            </tbody>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    notices_below:
                        merge_field_notice:
                            hidden: false
                            #The type is set in the PHP class.
                            message: "Should contain the merge field [[email_body_content]]."
        smtp:
            label: SMTP
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
                on: false
                validate_on_revert: true
            notices:
                php_mail:
                    show: true
                    visible_if:
                        lib.valueIsNot: smtp_specify_server,1
                    type: warning
                    message: >
                        Email from this site will be sent using the PHP mail() function.
                        This is not secure and email sent this way has a likelihood of being classed as spam.
                        We recommend changing to using an SMTP gateway.
            fields:
                description:
                    full_width: true
                    snippet:
                        html: |
                                    When Zenario sends an email, it can either use the PHP <code>mail()</code> function,
                                    or it can connect to a SMTP server.
                                    If not correctly set up, any emails sent could be lost without trace.
                
                smtp_specify_server:
                    site_setting:
                        name: smtp_specify_server
                    label: 'Specify a mail server:'
                    type: radios
                    value: ""
                    values:
                        0:
                            ord: 1
                            label: Use PHP mail() function
                            tooltip: |
                                With mail(), email sent from this site may not be encrypted (this depends on server-level settings). If your site may send password-related or other sensitive information it's better to use SMTP with a TLS secure connection.
                        1:
                            ord: 2
                            label: Use an SMTP gateway (recommended)
                    redraw_onchange: true
                smtp_host:
                    site_setting:
                        name: smtp_host
                    label: 'SMTP server hostname:'
                    type: text
                    value: ""
                    side_note: e.g. smtp.example.com. Get this information from your SMTP service provider.
                    visible_if: "zenarioAB.value('smtp_specify_server')"
                    indent: 1
                smtp_port:
                    site_setting:
                        name: smtp_port
                    label: 'Port number:'
                    type: select
                    value: 587
                    values:
                        587:
                            label: '587 (recommended)'
                        25:
                            label: '25'
                        1025:
                            label: '1025'
                        2587:
                            label: '2587'
                        465:
                            label: '465'
                        2465:
                            label: '2465'
                    visible_if: "zenarioAB.value('smtp_specify_server')"
                    indent: 1
                    side_note: Get this information from your SMTP service provider.
                    validation:
                        numeric: The SMTP port number must be numeric.
                smtp_security:
                    site_setting:
                        name: smtp_security
                    label: 'Security:'
                    type: select
                    value: ""
                    empty_value: None
                    values:
                        tls:
                            ord: 1
                            label: Transport Layer Security (TLS) (recommended)
                        ssl:
                            ord: 2
                            label: Secure Sockets Layer (SSL)
                    side_note: TLS is recommended as this is the latest secure standard.
                    visible_if: "zenarioAB.value('smtp_specify_server')"
                    indent: 1
                smtp_use_auth:
                    site_setting:
                        name: smtp_use_auth
                    label: 'Use authentication'
                    type: checkbox
                    value: ""
                    visible_if: "zenarioAB.value('smtp_specify_server')"
                    indent: 1
                    redraw_onchange: true
                smtp_username:
                    site_setting:
                        name: smtp_username
                    label: 'SMTP username:'
                    type: text
                    value: ""
                    visible_if: "1 * zenarioAB.value('smtp_specify_server') && zenarioAB.value('smtp_use_auth')"
                    indent: 2
                smtp_password:
                    site_setting:
                        name: smtp_password
                        secret: true
                    label: 'SMTP password:'
                    type: password
                    visible_if: "1 * zenarioAB.value('smtp_specify_server') && zenarioAB.value('smtp_use_auth')"
                    indent: 2
                base64_encode_emails:
                    site_setting:
                        name: base64_encode_emails
                    label: 'Encoding:'
                    type: radios
                    value: 1
                    values:
                        1:
                            ord: 1
                            label: Use base64 encoding (recommended)
                        '':
                            ord: 2
                            label: Automatic
                    note_below: |
                        Base64 encoding is the most reliable.
                        The "automatic" option will try to reduce the size of emails,
                        but this may result in emails appearing corrupted on some older email clients.
        test:
            priv: _PRIV_EDIT_SITE_SETTING
            label: Test
            edit_mode:
                enabled: true
            fields:
                description:
                    full_width: true
                    snippet:
                        html: |
                            This tab allows you to send a test email.
                            
                            If you do not receive the test email, you may need to change the settings on the Sending tab.
                test_send_from_address:
                    label: '"From" email address:'
                    type: text
                    readonly: true
                test_send_subject:
                    label: "Subject:"
                    type: text
                    readonly: true
                test_send_message:
                    label: "Message:"
                    type: editor
                    editor_type: readonly
                    readonly: true
                    disabled: true
                    editor_options:
                        height: 100
                test_send_format:
                    label: "Test email format:"
                    type: radios
                    values:
                        plain_text:
                            label: "Send as plain text"
                        standard_email_template:
                            label: "Use standard email template"
                    value: plain_text
                test_send_email_address:
                    type: text
                    maxlength: "100"
                    label: 'Test Send:'
                test_send_button:
                    same_row: true
                    type: submit
                    format_onchange: true
                    value: Test Send
                    class: zenario_submit_button
            notices:
                test_send_sucesses:
                    show: ""
                    type: success
                    message: ""
                test_send_error:
                    show: ""
                    type: error
                    message: ""
            show_errors_after_field: description
        debug:
            label: Debug
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
                on: false
            fields:
                description:
                    full_width: true
                    snippet:
                        html: "This tab contains settings for overriding the recipient's address for all emails sent by Zenario."
                debug_override_enable:
                    label: 'Debug mode'
                    site_setting:
                        name: debug_override_enable
                        protect_from_database_restore: true
                    type: checkbox
                    value: ""
                    format_onchange: true
                    note_below: "Route all email to the debug email address rather than recipients' email addresses, or not send at all."
                    side_note: "The debug mode will not divert or stop emails to support an administator logging in."
                send_to_debug_address_or_dont_send_at_all:
                    site_setting:
                        name: send_to_debug_address_or_dont_send_at_all
                        protect_from_database_restore: true
                    type: radios
                    indent: 1
                    label: "Debug behaviour:"
                    values:
                        dont_send_at_all:
                            ord: 1
                            label: "Don't send email at all"
                        send_to_debug_email_address:
                            ord: 2
                            label: "Send all email to a debug email address"
                    format_onchange: true
                    visible_if: lib.value('debug_override_enable')
                    value: send_to_debug_email_address
                debug_override_email_address:
                    label: 'Debug email address:'
                    site_setting:
                        name: debug_override_email_address
                        protect_from_database_restore: true
                    type: text
                    indent: 2
                    value: ""
                    validation:
                        required_if_not_hidden: Please enter an email address.
                        email: Please enter a valid email address.
                    visible_if: lib.value('debug_override_enable') && (lib.value('send_to_debug_address_or_dont_send_at_all') == 'send_to_debug_email_address')

        styles:
            label: Pre-defined styles
            edit_mode:
                enabled: false
            fields:
                description:
                    full_width: true
                    snippet:
                        html: |
                            These pre-defined styles will be available when composing a newsletter or an email template.
                            You can add more by editing the <code>zenario_custom/site_description.yaml</code> file.
                email_style_formats:
                    type: code_editor
                    tall_as_possible: true
                    dont_trim: true
                    language: yaml
                    style: |
                        height: 30em;
                        width: 99%;
                description2:
                    full_width: true
                    snippet:
                        html: |
                            See
                                <a href="http://www.tinymce.com/wiki.php/Configuration:style_formats" target="_blank">
                                    http://www.tinymce.com/wiki.php/Configuration:style_formats</a>
                            for more information.
        css_rules:
            label: Email CSS rules
            edit_mode:
                enabled: true
                priv: _PRIV_EDIT_SITE_SETTING
                on: false
            fields:
                description:
                    full_width: true
                    snippet:
                        html: |
                            <p>These CSS rules will be available when composing an email template.</p>
                            <p>The contents are automatically wrapped in <code>&lt;style&gt;&lt;/style&gt;</code> tags.</p>
                email_css_rules:
                    site_setting:
                        name: email_css_rules
                    label: 'CSS rules:'
                    type: code_editor
                    tall_as_possible: true
                    dont_trim: true
                    language: css
                    style: >
                        width: 98%;
