<% extends 'layout.html' %>

<% block content %>
  <div id="settings_container"></div>

  <script type="text/javascript">
    <% autoescape 'js' %>
      var mailpoet_woocommerce_active = <%= json_encode(is_woocommerce_active == true) %>;
      var mailpoet_members_plugin_active = <%= json_encode(is_members_plugin_active == true) %>;
      var mailpoet_is_new_user = <%= json_encode(is_new_user == true) %>;
      var mailpoet_settings = <%= json_encode(settings) %>;
      var mailpoet_segments = <%= json_encode(segments) %>;
      var mailpoet_pages = <%= json_encode(pages) %>;
      var mailpoet_mss_key_valid = <%= json_encode(mss_key_valid) %>;
      var mailpoet_premium_key_valid = <%= json_encode(premium_key_valid) %>;
      var mailpoet_premium_plugin_installed = <%= json_encode(premium_plugin_installed) %>;
      var mailpoet_paths = <%= json_encode(paths) %>;
      var mailpoet_built_in_captcha_supported = <%= json_encode(built_in_captcha_supported == true) %>;
      var mailpoet_free_plan_url = "<%= add_referral_id('https://www.mailpoet.com/free-plan') %>";
      var mailpoet_current_user_email = "<%= current_user.user_email %>";
      var mailpoet_hosts = <%= json_encode(hosts) %>;
    <% endautoescape %>
    var mailpoet_beacon_articles = [
      '57f71d49c697911f2d323486',
      '57fb0e1d9033600277a681ca',
      '57f49a929033602e61d4b9f4',
      '57fb134cc697911f2d323e3b',
    ];
  </script>
<% endblock %>
<% block translations %>
  <%= localize({
    'settings': __('Settings'),
    'basicsTab': __('Basics'),
    'signupConfirmationTab': __('Sign-up Confirmation'),
    'sendWithTab': __('Send With...'),
    'wooCommerceTab': __('WooCommerce'),
    'advancedTab': __('Advanced'),
    'keyActivationTab': __('Key Activation'),

    'saveSettings': __('Save settings'),
    'settingsSaved': __('Settings saved'),

    'defaultSenderTitle': __('Default sender'),
    'defaultSenderDescription': __('These email addresses will be selected by default for each new email.'),
    'from': __('From'),
    'yourName': __('Your name'),
    'replyTo': __('Reply-to'),

    'subscribeInCommentsTitle': __('Subscribe in comments'),
    'subscribeInCommentsDescription': __('Visitors that comment on a post can subscribe to your list via a checkbox.'),
    'subscribeInRegistrationTitle': __('Subscribe in registration form'),
    'subscribeInRegistrationDescription': __('Allow users who register as a WordPress user on your website to subscribe to a MailPoet list (in addition to the "WordPress Users" list). This also enables WordPress users to receive confirmation emails (if sign-up confirmation is enabled).'),
    'usersWillBeSubscribedTo': __('Users will be subscribed to these lists:'),
    'yesAddMe': __('Yes, add me to your mailing list'),
    'chooseList': __('Choose a list'),

    'manageSubTitle': __('Manage Subscription page'),
    'manageSubDescription1': __('When your subscribers click the "Manage your subscription" link, they will be directed to this page.'),
    'manageSubDescription2': __('If you want to use a custom Subscription page, simply paste this shortcode on to a WordPress page: [mailpoet_manage_subscription]'),
    'previewPage': __('Preview page'),
    'preview': __('Preview'),
    'subscribersCanChooseFrom': __('Subscribers can choose from these lists:'),
    'leaveEmptyToDisplayAll': __('Leave this field empty to display all lists'),

    'unsubscribeTitle': __('Unsubscribe page'),
    'unsubscribeDescription1': __('When your subscribers click the "Unsubscribe" link, they will be directed to this page.'),
    'unsubscribeDescription2': __('If you want to use a custom Unsubscribe page, simply paste this shortcode on to a WordPress page: [mailpoet_manage text="Manage your subscription"]'),

    'statsNotifsTitle': _x('Stats notifications', 'name of a setting to automatically send statistics (newsletter open rate, click rate, etc) by email'),
    'statsNotifsDescription': _x(
      'Enter the email address that should receive your newsletter’s stats 24 hours after it has been sent, or every first Monday of the month for Welcome Emails and WooCommerce emails.',
      'Please reuse the current translations of “Welcome Emails”'
    ),
    'newslettersAndPostNotifs': __('Newsletters and Post Notifications'),
    'welcomeAndWcEmails': _x('Welcome Emails and WooCommerce emails', 'Please reuse the current translations of “Welcome Emails”'),
    'pleaseFillEmail': __('Please fill the email address.'),

    'newSubscriberNotifsTitle': __('New subscriber notifications'),
    'newSubscriberNotifsDescription': __('Enter the email address that should receive notifications when someone subscribes.'),
    'yes': __('Yes'),
    'no': __('No'),
    'never': __('Never'),

    'archiveShortcodeTitle': __('Archive page shortcode'),
    'archiveShortcodeDescription': __('Paste this shortcode on a page to display a list of past newsletters.'),
    'subscribersCountShortcodeTitle': __('Shortcode to display total number of subscribers'),
    'subscribersCountShortcodeDescription': __('Paste this shortcode on a post or page to display the total number of confirmed subscribers.'),

    'gdprTitle': __('Be GDPR compliant'),
    'gdprDescription': __('You need to comply with European law in regards to data privacy if you have European subscribers. Rest assured, it’s easy!'),
    'readGuide': __('Read our guide'),

    'invalidEmail': __('Invalid email address'),

    'enableSignupConfTitle': __('Enable sign-up confirmation'),
    'enableSignupConfDescription': __("If you enable this option, your subscribers will first receive a confirmation email after they subscribe. Once they confirm their subscription (via this email), they will be marked as 'confirmed' and will begin to receive your email newsletters."),
    'readAboutDoubleOptIn': __('Read more about Double Opt-in confirmation.'),
    'signupConfirmationIsMandatory': __('Sign-up confirmation is mandatory when using the MailPoet Sending Service.'),
    'emailSubject':  __('Email subject'),
    'emailContent':  __('Email content'),
    'emailContentDescription': __("Don't forget to include:<br /><br />[activation_link]Confirm your subscription.[/activation_link]<br /><br />Optional: [lists_to_confirm]."),
    'confirmationPage': __('Confirmation page'),
    'confirmationPageDescription': __('When subscribers click on the activation link, they will be redirected to this page.'),
    'subscribersNeedToActivateSub': __('Subscribers will need to activate their subscription via email in order to receive your newsletters. This is highly recommended!'),
    'newSubscribersAutoConfirmed': __('New subscribers will be automatically confirmed, without having to confirm their subscription. This is not recommended!'),

    'bounceEmail': __('Bounce email address'),
    'yourBouncedEmails': __('Your bounced emails will be sent to this address.'),
    'readMore': _x('Read more.', 'support article link label'),
    'taskCron': __('Newsletter task scheduler (cron)'),
    'taskCronDescription': __('Select what will activate your newsletter queue.'),
    'websiteVisitors': __('Visitors to your website (recommended)'),
    'mailpoetScript': __("MailPoet's own script. Doesn't work with [link]these hosts[/link]."),
    'serverCron': __("Server side cron (Linux cron)"),
    'addCommandToCrontab': __("To use this option please add this command to your crontab:"),
    'withFrequency': __("With the frequency of running it every minute:"),
    'rolesTitle': __('Roles and capabilities'),
    'rolesDescription': __('Manage which WordPress roles access which features of MailPoet.'),
    'manageUsingMembers': __('Manage using the Members plugin'),
    'installMembers': __('Install the plugin [link]Members[/link] (free) to manage permissions.'),
    'trackingTitle': __('Open and click tracking'),
    'trackingDescription': __('Enable or disable open and click tracking.'),
    'transactionalTitle': _x('Send all site’s emails with…', 'Transational emails settings title'),
    'transactionalDescription': _x('Choose which method to send all your WordPress emails (e.g. password reset, new registration, WooCommerce invoices, etc.).', 'Transational emails settings description'),
    'transactionalLink': _x('Read more.', 'Transactional emails settings link'),
    'transactionalCurrentMethod': _x('The current sending method, eg. “MailPoet Sending Service” or “Sendgrid” (recommended)', 'Transactional emails settings option'),
    'transactionalWP': _x('The default WordPress sending method (default)', 'Transactional emails settings option'),
    'inactiveSubsTitle': __('Stop sending to inactive subscribers'),
    'inactiveSubsDescription': __("Gmail, Yahoo and other email providers will treat your emails like spam if your subscribers don't open your emails in the long run. This option will mark your subscribers as Inactive and MailPoet will stop sending to them."),
    'disabledBecauseTrackingIs': __('This option is disabled because tracking is disabled.'),
    'after3months': __('After 3 months (recommended if you send once a day)'),
    'after6months': __('After 6 months (default, recommended if you send at least once a month)'),
    'after12months': __('After 12 months'),
    'shareDataTitle': __('Share anonymous data'),
    'shareDataDescription': __('Share anonymous data and help us improve the plugin. We appreciate your help!'),
    'captchaTitle': __('Protect your forms against spam signups'),
    'captchaDescription': __('Built-in captcha protects your subscription forms after a second signup attempt by a bot. Alternatively, use reCAPTCHA by Google.'),
    'signupForCaptchaKey': __('Sign up for an API key pair here.'),
    'builtInCaptcha': __('Built-in captcha (default)'),
    'disbaledBecauseExtensionMissing': __('(disabled because GD or FreeType extension is missing)'),
    'googleReCaptcha': __('Google reCAPTCHA'),
    'yourReCaptchaKey': __('Your reCAPTCHA Site Key'),
    'yourReCaptchaSecret': __('Your reCAPTCHA Secret Key'),
    'fillReCaptchaKeys': __('Please fill the reCAPTCHA keys.'),
    'disable': __('Disable'),
    'reinstallTitle': __('Reinstall from scratch'),
    'reinstallDescription': __('Want to start from the beginning? This will completely delete MailPoet and reinstall it from scratch. Remember: you will lose all of your data!'),
    'reinstallNow':  __('Reinstall now...'),
    'loggingTitle': __('Logging'),
    'loggingDescription': __('Enables logging for diagnostics of plugin behavior.'),
    'everythingLogOption': _x('Everything', 'In settings: "Logging: Everything"'),
    'errorsLogOption': _x('Errors only', 'In settings: "Logging: Errors only"'),
    'nothingLogOption': _x('Nothing', 'In settings: "Logging: Nothing"'),
    'reinstallConfirmation': __('Are you sure? All of your MailPoet data will be permanently erased (newsletters, statistics, subscribers, etc.).'),


    'announcementHeader': __('Get notified when someone subscribes'),
    'announcementParagraph1': __('It’s been a popular feature request from our users, we hope you get lots of emails about all your new subscribers!'),
    'announcementParagraph2': __('(You can turn this feature off if it’s too many emails.)'),

    'premiumTabActivationKeyLabel': __('Activation Key', 'mailpoet'),
    'premiumTabDescription': __('This key is used to validate your free or paid subscription. Paying customers will enjoy automatic upgrades of their Premium plugin and access to faster support.', 'mailpoet'),
    'premiumTabNoKeyNotice': __('Please specify a license key before validating it.', 'mailpoet'),
    'premiumTabVerifyButton': __('Verify', 'mailpoet'),
    'premiumTabKeyValidMessage': __('Your key is valid', 'mailpoet'),
    'premiumTabKeyNotValidMessage': __('Your key is not valid', 'mailpoet'),
    'premiumTabPremiumActiveMessage': __('MailPoet Premium is active', 'mailpoet'),
    'premiumTabPremiumInstallingMessage': __('MailPoet Premium plugin is being installed', 'mailpoet'),
    'premiumTabPremiumActivatingMessage': __('MailPoet Premium plugin is being activated', 'mailpoet'),
    'premiumTabPremiumNotInstalledMessage': __('MailPoet Premium is not installed.', 'mailpoet'),
    'premiumTabPremiumInstallMessage': __('Install MailPoet Premium plugin', 'mailpoet'),
    'premiumTabPremiumNotActiveMessage': __('MailPoet Premium is not active.', 'mailpoet'),
    'premiumTabPremiumActivateMessage': __('Activate MailPoet Premium plugin', 'mailpoet'),
    'premiumTabPremiumInstallationInstallingMessage': __('downloading MailPoet Premium…', 'mailpoet'),
    'premiumTabPremiumInstallationActivatingMessage': __('activating MailPoet Premium…', 'mailpoet'),
    'premiumTabPremiumInstallationActiveMessage': __('MailPoet Premium is active!', 'mailpoet'),
    'premiumTabPremiumInstallationErrorMessage': __('Something went wrong. Please [link]download the Premium plugin from your account[/link] and [link]contact our support team[/link].', 'mailpoet'),
    'premiumTabPremiumKeyNotValidMessage': __('Your key is not valid for MailPoet Premium', 'mailpoet'),
    'premiumTabMssActiveMessage': __('MailPoet Sending Service is active', 'mailpoet'),
    'premiumTabMssNotActiveMessage': __('MailPoet Sending Service is not active.', 'mailpoet'),
    'premiumTabMssActivateMessage': __('Activate MailPoet Sending Service', 'mailpoet'),
    'premiumTabMssKeyNotValidMessage': __('Your key is not valid for the MailPoet Sending Service', 'mailpoet'),
    'premiumTabPendingApprovalHeading': __('Note: your account is pending approval by MailPoet.', 'mailpoet'),
    'premiumTabPendingApprovalMessage': __('Rest assured, this only takes just a couple of hours. Until then, you can still send email previews to yourself. Any active automatic emails, like Welcome Emails, will be paused.', 'mailpoet'),
    'premiumTabCongratulatoryMssEmailSent': __('A test email was sent to [email_address]', 'mailpoet'),

    'wcCustomizerTitle': _x('Use MailPoet to customize WooCommerce emails', "Setting for using our editor for WooCommerce email"),
    'wcCustomizerDescription': _x('You can use the MailPoet editor to customize the template used to send WooCommerce emails (notification for order processing, completed, ...).', "Setting for using our editor for WooCommerce email"),
    'openTemplateEditor': _x('Open template editor', 'Settings button to go to WooCommerce email editor'),
    'wcOptinTitle': _x('Opt-in on checkout', "settings area: add an email opt-in checkbox on the checkout page (e-commerce websites)"),
    'wcOptinDescription': __('Customers can subscribe to the "WooCommerce Customers" list via a checkbox on the checkout page.'),
    'wcOptinMsgTitle': _x('Checkbox opt-in message', "settings area: set the email opt-in message on the checkout page (e-commerce websites)"),
    'wcOptinMsgDescription': __('This is the checkbox message your customers will see on your WooCommerce checkout page to subscribe to the "WooCommerce Customers" list.'),
    'wcOptinMsgPlaceholder': _x('Checkbox opt-in message', "placeholder text for the WooCommerce checkout opt-in message"),
    'wcOptinMsgCannotBeEmpty': __('The checkbox opt-in message cannot be empty.'),
    'subscribeOldWCTitle': __('Subscribe old WooCommerce customers'),
    'subscribeOldWCDescription': __('Subscribe all my past customers to this list because they agreed to receive marketing emails from me.'),
    'enableCookiesTitle': _x('Enable browser cookies', 'Option in settings page: the user can accept or forbid MailPoet to use browser cookies'),
    'enableCookiesDescription': _x('If you enable this option, MailPoet will use browser cookies for more precise WooCommerce tracking. This is practical for abandoned cart emails for example.', 'Browser cookies are data created by websites and stored in visitors web browser'),

    'mssTitle': __('MailPoet Sending Service'),
    'youreSendingWithMss': __("You're now sending with MailPoet!"),
    'solveSendingProblems': __("Solve all of your sending problems!"),
    'mssBenefit1': __('Reach the inbox, not the spam box.'),
    'mssBenefit2': __('Easy configuration: enter a key to activate the sending service.'),
    'mssBenefit3': __('Super fast: send up to 50,000 emails per hour.'),
    'mssBenefit4': __('All emails are signed with SPF & DKIM.'),
    'mssBenefit5': __('Automatically remove invalid and bounced addresses (bounce handling) to keep your lists clean.'),
    'seeVideo': __('See video guide'),
    'activate': __('Activate'),
    'activated': __('Activated'),
    'freeUpto': __('Free up to 1,000 subscribers'),
    'or': __('or'),
    'enterYourKey': __("[link]enter your key[/link]"),
    'otherTitle': __('Other'),
    'otherDescription': __('Send emails via your host (not recommended!) or via a third-party sender.'),
    'otherCons1':  __("Unless you're a pro, you’ll probably end up in spam."),
    'otherCons2': __("Sending speed is limited by your host and/or your third-party (with a 2,000 per hour maximum)."),
    'otherCons3': __("Manual configuration of SPF and DKIM required."),
    'otherCons4': __("Bounce handling is available, but only with an extra [link]add-on[/link]."),
    'configure': __('Configure'),
    'method': __('Method'),
    'hostOption': __('Your web host / web server'),
    'smtpOption': __('SMTP'),
    'selectProvider': __('Select your provider'),
    'yourHost': __('Your web host'),
    'notListed': __('Not listed (default)'),
    'sendingFrequency': __('Sending frequency'),
    'recommendedTitle': __('Recommended'),
    'recommended': __('recommended'),
    'ownFrequency': __("I'll set my own frequency"),
    'emails': __('emails'),
    'xEmails': __('%1$s emails'),
    'everyMinute': __('every minute'),
    'everyMinutes': __('every %1$d minutes'),
    'everyHour': __('every hour'),
    'everyHours': __('every %1$d hours'),
    'thatsXEmailsPerDay': __("That's <strong>%1$s emails</strong> per day"),
    'thatsXEmailsPerSecond': __("That's %1$s emails per second. <strong>We highly recommend to send 1 email per second, at the absolute maximum.</strong> MailPoet needs at least one second to process and send a single email (on most hosts.) <strong>Alternatively, send with MailPoet, which can be up to 50 times faster.</strong>"),
    'frequencyWarning': __('<strong>Warning!</strong> You may break the terms of your web host or provider by sending more than the recommended emails per day. Contact your host if you want to send more.'),
    'smtpHost': __('SMTP Hostname'),
    'smtpHostExample': __('e.g.: smtp.mydomain.com'),
    'smtpPort': __('SMTP Port'),
    'region': __('Region'),
    'accessKey': __('Access Key'),
    'secretKey': __('Secret Key'),
    'apiKey': __('API Key'),
    'login': __('Login'),
    'password': __('Password'),
    'secureConnectioon': __('Secure Connection'),
    'authentication': __('Authentication'),
    'authenticationDescription': __('Leave this option set to Yes. Only a tiny portion of SMTP services prefer Authentication to be turned off.'),
    'spfTitle': __('SPF Signature (Highly recommended!)'),
    'spfDescription': __("This improves your delivery rate by verifying that you're allowed to send emails from your domain."),
    'spfSetup': __("SPF is set up in your DNS. Read your host's support documentation for more information."),
    'testSending': __('Test the sending method'),
    'sendTestEmail': __('Send a test email'),
    'testEmailTooltip': __("Didn't receive the test email? Read our [link]quick guide[/link] to sending issues."),
    'cantSendEmail': __('The email could not be sent. Make sure the option "Email notifications" has a FROM email address in the Basics tab.'),
    'testEmailSubject': __('This is a Sending Method Test'),
    'testEmailBody': __('Yup, it works! You can start blasting away emails to the moon.'),
    'emailSent': __('The email has been sent! Check your inbox.'),
    'orCancel': __('or Cancel'),
  }) %>
<% endblock %>

<% block after_javascript %>
<%= javascript('settings.js')%>
<% endblock %>
