<% extends 'layout.html' %>

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

  <script type="text/javascript">
    <% autoescape 'js' %>
      var mailpoet_authorized_emails = <%= json_encode(authorized_emails) %>;
      var mailpoet_verified_sender_domains = <%= json_encode(verified_sender_domains) %>;
      var mailpoet_all_sender_domains = <%= json_encode(all_sender_domains) %>;
      var mailpoet_members_plugin_active = <%= json_encode(is_members_plugin_active == 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_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': __('Want to use a custom Subscription page? Check out our [link]Knowledge Base[/link] for instructions.'),
    'previewPage': __('Preview page'),
    'preview': __('Preview'),
    'subscribersCanChooseFrom': __('Subscribers can choose from these lists:'),
    'leaveEmptyToDisplayAll': __('Leave this field empty to display all lists'),

    'reEngagementTitle': __('Re-engagement page'),
    'reEngagementDescription': __('Thank your subscribers reactivated by the Re-engagement email for their continued interest in your emails.'),

    'unsubscribeTitle': __('Unsubscribe page'),
    'unsubscribeDescription1': __('When your subscribers click the "Unsubscribe" link, they will be directed to a confirmation page. After confirming, the success page will be shown. These pages must contain the [mailpoet_page] shortcode.'),
    'unsubscribeDescription2': _x('[link]Learn more about customizing these pages.[/link]', 'Unsubscribe pages customization link'),
    'confirmationPageTitle': __('Confirmation page'),
    'successPageTitle': __('Success page'),

    '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'),
    'youNeedToAuthorizeTheEmail': __('Not an authorized sender email address. [link]Authorize it now.[/link]'),
    'authorizeMyEmail': __('Authorize my email address'),
    'authorizeSenderDomain': __('Email violates Sender Domain’s DMARC policy. Please set up [link]sender authentication[/link].'),

    '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'),
    'serverCron': __("Server side cron (Linux cron)"),
    'actionSchedulerCron': __("WordPress built-in cron (recommended)"),
    '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.'),
    're-engagementDisabledNotice': __('Re-engagement emails were deactivated.'),
    're-engagementReactivatedNotice': __("Re-engagement emails are now enabled. Don’t forget to [link]activate them[/link]."),
    '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 - %1$s (recommended)', 'Transactional emails settings option'),
    'transactionalMssNote': __('Note: attachments, CC, BCC and multiple TO are not supported. [link]Learn more[/link]'),
    '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 (recommended if you send at least twice a month)'),
    'after12months': __('After 12 months (default)'),
    'after18months': __('After 18 months'),
    'libs3rdPartyTitle': __('Load 3rd-party libraries'),
    'libs3rdPartyDescription': __('E.g. Google Fonts (used in Form Editor) and HelpScout (used for support). This needs to be enabled if you want to be able to contact support.'),
    '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 against bots. Alternatively, use reCAPTCHA by Google.'),
    'reCaptchaDescription': __('Please use the same reCAPTCHA type as in Google reCAPTCHA Settings.'),
    'signupForCaptchaKey': __('Sign up for an API key pair here.'),
    'builtInCaptcha': __('Built-in CAPTCHA (default)'),
    'disbaledBecauseExtensionMissing': __('(disabled because GD or FreeType extension is missing)'),
    'googleReCaptchaCheckbox': __('Google reCAPTCHA v2 Checkbox'),
    'googleReCaptchaInvisible': __('Google reCAPTCHA v2 Invisible'),
    'yourReCaptchaKey': __('Your reCAPTCHA Site Key'),
    'yourReCaptchaSecret': __('Your reCAPTCHA Secret Key'),
    'fillReCaptchaKeys': __('Please fill the reCAPTCHA keys.'),
    'disable': __('Disable'),
    'recalculateSubscribersScoreTitle': __('Recalculate Subscriber Scores'),
    'recalculateSubscribersScoreDescription': __('MailPoet will recalculate subscriber engagement scores for all subscribers. This may take some time to complete.'),
    'recalculateSubscribersScoreNow':  __('Update now…'),
    'recalculateSubscribersScoreNotice':  __('Subscriber score recalculation has been scheduled and will start soon. It may take some time to complete.'),
    '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.'),
    'loggingDescriptionLink': __('See logs.'),
    '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'),
    'premiumTabKeyCannotValidate': __('Yikes, we can’t validate your key because:'),
    'premiumTabKeyCannotValidateLocalhost': __('You’re on localhost or using an IP address instead of a domain. Not allowed for security reasons!'),
    'premiumTabKeyCannotValidateBlockingHost': __('Your host is blocking the activation, e.g. Altervista'),
    'premiumTabKeyCannotValidateIntranet': __('This website is on an Intranet. Activating MailPoet will not be possible.'),
    'learnMore': __('Learn more'),
    'premiumTabPremiumActiveMessage': __('MailPoet Premium is active', 'mailpoet'),
    'premiumTabPremiumNotInstalledMessage': __('MailPoet Premium is not installed.', 'mailpoet'),
    'premiumTabPremiumNotActivatedMessage': __('MailPoet Premium is installed but not activated.', 'mailpoet'),
    'premiumTabPremiumDownloadMessage': __('Download MailPoet Premium plugin', '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 and optionally other lists via a checkbox on the checkout page.'),
    'wcOptinSegmentsTitle': __('Lists to also subscribe customers to:'),
    'leaveEmptyToSubscribeToWCCustomers': __('Leave empty to subscribe only to "WooCommerce Customers" list'),
    'wcOptinSegmentsPlaceholder': __('Select lists...'),
    '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 and lists selected in "Opt-in on checkout" setting.'),
    '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.'),

    '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'),
    'sendViaHost': __('Send emails via your host'),
    'notRecommended':__('(not recommended!)'),
    'orViaThirdParty': __('or via a third-party sender.'),
    'invalidKeyForMss': __('Your key is not valid for MailPoet Sending Service.'),
    'getPlan': __('Get a new plan'),
    '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'),

    'engagementTrackingTitle': __('Engagement analytics tracking'),
    'engagementTrackingDescription': __('Choose the balance between subscriber privacy and deeper engagement insights that is right for your business.'),
    'engagementTrackingFull': __('Full – additionally use browser cookies to improve the site and email engagement tracking and abandoned cart email accuracy.'),
    'engagementTrackingPartial': __('Partial – additionally track email engagement (opens, clicks). Disable cookie-based tracking.'),
    'engagementTrackingBasic': __('Basic – only use data your site already has about your subscribers. Disable email engagement and cookie-based tracking, and re-engagement emails.'),
  }) %>
<% endblock %>

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