<% set csvDescription = __('This file needs to be formatted in a CSV style (comma-separated-values). Look at some [link]examples on our support site[/link].') %>
<% extends 'layout.html' %>
<% block content %>
<div id="mailpoet_subscribers_import" class="wrap">
  <div class="mailpoet-top-bar">
    <a href="?page=mailpoet-subscribers#/" role="button" class="mailpoet-top-bar-logo" title="Back to section root" tabindex="0">
      <img src="<%= cdn_url('logo-orange.svg') %>" alt="MailPoet logo" />
    </a>
    <style>#wpbody-content { padding-top: 64px; } .wrap { margin-top: 20px; }</style>
  </div>

  <div class="mailpoet-page-header">
    <div class="mailpoet-back-button">
      <a href="?page=mailpoet-subscribers#/" aria-label="Navigate to the lists page" class="components-button is-small has-icon">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"></path></svg>
      </a>
    </div>
    <h1 class="wp-heading-inline"><%= __('Import subscribers') %></h1>
  </div>

  <!-- STEP subscriber data manipulation -->
  <% include 'subscribers/importExport/import/step_data_manipulation.html' %>
  <div id="import_container" class="mailpoet-tab-content"></div>
</div>

<script type="text/javascript">
  var
    maxPostSize = '<%= maxPostSize %>',
    roleBasedEmails = JSON.parse("<%=role_based_emails|escape('js')%>"),
    maxPostSizeBytes = '<%= maxPostSizeBytes %>',
    importData = {},
    mailpoetColumnsSelect2 = JSON.parse("<%=subscriberFieldsSelect2|escape('js')%>"),
    mailpoetColumns = JSON.parse("<%=subscriberFields|escape('js')%>"),
    mailpoetSegments = JSON.parse("<%=segments|escape('js')%>");
</script>

<%= localize({
'noMailChimpLists': __('No active lists found'),
'serverError': __('Server error:'),
'select': __('Select', 'Form input type'),
'wrongFileFormat': __('Only comma-separated (CSV) file formats are supported.'),
'maxPostSizeNotice': __('Your CSV is over %s and is too big to process. Please split the file into two or more sections.')|replace({'%s': maxPostSize}),
'dataProcessingError': __("Your data could not be processed. Please make sure it is in the correct format."),
'noValidRecords': __('No valid records were found. This file needs to be formatted in a CSV style (comma-separated). Look at some [link]examples on our support site.[/link]'),
'importNoticeSkipped': __('%1$s records had issues and were skipped.'),
'importNoticeInvalid': __('%1$s emails are not valid: %2$s'),
'importNoticeRoleBased': _x('%1$s [link]role-based addresses[/link] are not permitted: %2$s', 'Error message when importing addresses like postmaster@domain.com'),
'importNoticeDuplicate': __('%1$s emails appear more than once in your file: %2$s'),
'hideDetails': __('Hide details'),
'showDetails': __('Show more details'),
'segmentSelectionRequired': __('Please select at least one list'),
'addNewList': __('Add new list'),
'addNewField': __('Add new field'),
'addNewColumuserColumnsn': __('Add new list'),
'userColumns': __('User fields'),
'selectedValueAlreadyMatched': __('The selected value is already matched to another field.'),
'confirmCorrespondingColumn': __('Confirm that this field corresponds to the selected field.'),
'columnContainInvalidElement': __('One of the fields contains an invalid email. Please fix it before continuing.'),
'january': __('January'),
'february': __('February'),
'march': __('March'),
'april': __('April'),
'may': __('May'),
'june': __('June'),
'july': __('July'),
'august': __('August'),
'september': __('September'),
'october': __('October'),
'november': __('November'),
'december': __('December'),
'noDateFieldMatch': __("Do not match as a 'date field' if most of the rows for that field return the same error."),
'emptyFirstRowDate': __('First row date cannot be empty.'),
'verifyDateMatch': __('Verify that the date in blue matches the original date.'),
'pm': __('PM'),
'am': __('AM'),
'dateMatchError': __('Error matching date'),
'columnContainsInvalidDate': __('One of the fields contains an invalid date. Please fix before continuing.'),
'listCreateError': __('Error adding a new list:'),
'columnContainsInvalidElement': __('One of the fields contains an invalid email. Please fix before continuing.'),
'customFieldCreateError': __('Custom field could not be created'),
'subscribersCreated': __('%1$s subscribers added to %2$s.'),
'subscribersUpdated': __('%1$s existing subscribers were updated and added to %2$s.'),
'importNoAction': __('No subscribers were added or updated.'),
'importNoWelcomeEmail': __('Note: Imported subscribers will not receive any Welcome Emails'),
'readSupportArticle': __('Read the support article.'),
'validationStepHeading': _x('Are you importing an existing list or contacts from your address book?', 'Question for importing subscribers into MailPoet'),
'validationStepRadio1': _x('Existing list', 'User choice to import an existing email list'),
'validationStepRadio2': _x('Contacts from my address book', 'User choice to import his address book contacts'),
'validationStepBlock1': _x('You will need to ask your contacts to join your list instead of importing them. This is a standard practice to ensure good email deliverability.', 'Paragraph explaining the user what to do when importing his contacts.'),
'validationStepBlock2': _x('If you send with MailPoet, we will detect if you import subscribers without their explicit consent and suspend your account.', 'Paragraph warning what happens if user imports his contacts and sends with MailPoet'),
'validationStepBlockButton': _x('How to ask your contacts to join your list', 'Button to visit a support article'),
'validationStepLastSentHeading': _x('When did you last send an email to this list?', 'Question for users importing their list'),
'validationStepLastSentOption1': __('Over 2 years ago'),
'validationStepLastSentOption2': __('Between 1 and 2 years ago'),
'validationStepLastSentOption3': __('Within the last year'),
'validationStepLastSentOption4': __('Within the last 3 months'),
'validationStepLastSentNext': __('Next'),
'previousStep': __('Previous step'),
'nextStep': __('Next step'),
'import': __('Import'),
'seeVideo': __(' See video guide'),
'importAgain': __('Import again'),
'viewSubscribers': __('View subscribers'),
'methodPaste': __('Paste the data into a text box'),
'pickLists': __('Pick one or more list(s)'),
'pickListsDescription': __('Pick the list that you want to import these subscribers to.'),
'select': _x('Select', ' Verb'),
'createANewList': __('Create a new list'),
'updateExistingSubscribers': __('Update existing subscribers’ information, like first name, last name, etc.'),
'updateExistingSubscribersYes': __('Yes'),
'updateExistingSubscribersNo': __('No'),
'addSubscribersToSegment': __(' To add subscribers to a mailing segment, [link]create a list[/link].'),
'methodUpload': __('Upload a file'),
'methodMailChimp': __('Import from Mailchimp'),
'methodMailChimpLabel': __('Enter your Mailchimp API key'),
'methodMailChimpDescription': __('Find your Mailchimp API key in our [link]documentation[/link].'),
'methodMailChimpVerify': __('Verify'),
'methodMailChimpSelectList': __('Select list(s)'),
'methodMailChimpSelectPlaceholder': _x('Select', 'Verb'),
'matchData': __('Match data'),
'showMoreDetails': __('Show more details'),
'pasteLabel': __('Copy and paste your subscribers from Excel/Spreadsheets'),
'pasteDescription': __('This file needs to be formatted in a CSV style (comma-separated-values.) Look at some [link]examples on our support site[/link].'),
'methodSelectionHead': __('How would you like to import subscribers?'),
'cleanListText1': __('We highly recommend cleaning your lists before importing them to MailPoet.'),
'cleanListText2': __('Lists can have up to 20% of invalid addresses after a year because people change jobs and stop using their addresses. If you send with MailPoet, we will pause your sending and ask you to clean your list if we detect over 10% of invalid addresses.'),
'tryListCleaning': _x('How can I clean my list?', 'CTA button label'),
'cleanedList': _x('I cleaned my list', 'Text in button'),
'listCleaningGotIt': _x('Got it, I’ll proceed to import', 'Text in a link'),
'subscribed': __('Subscribed'),
'unsubscribed': __('Unsubscribed'),
'inactive': __('Inactive'),
'dontUpdate': _x('Don’t update', 'This is a value in a select box for "Set new subscribers’ status to"'),
'newSubscribersStatus': __('Set new subscribers’ status to'),
'consentSubscribed': __('Choose “Subscribed” only if you have explicit consent to send them bulk or marketing emails. [link]Why is consent important?[/link]'),
'congratulationResult': __('Congratulations, you’ve imported your subscribers!'),
'suppressionListReminder': __('Are you importing subscribers from another marketing service provider? You may need to separately import the list of bad or previously unsubscribed addresses to avoid contacting them. [link]See how to import a suppression list.[/link]'),
'existingSubscribersStatus': __('Update existing subscribers’ status to'),
'assignTagsLabel': __('Assign tags'),
'assignTagsDescription': __('Pick a tag or create a new one to assign to these subscribers.'),
'addNewTag': __('Add new tag'),
}) %>
<% endblock %>
