<% 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">
  <h1 class="mailpoet-h1 mailpoet-title">
    <span><%= __('Import') %></span>
    <a class="mailpoet-button button button-secondary button-small" href="?page=mailpoet-subscribers#/"><%= __('Back to Subscribers') %></a>
  </h1>
  <!-- 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 = <%= role_based_emails|raw %>,
    maxPostSizeBytes = '<%= maxPostSizeBytes %>',
    importData = {},
    mailpoetColumnsSelect2 = <%= subscriberFieldsSelect2|raw %>,
    mailpoetColumns = <%= subscriberFields|raw %>,
    mailpoetSegments = <%= segments|raw %>;
    <% set newUser = (is_new_user == true) ? 'true' : 'false' %>
    var mailpoet_is_new_user = <%= newUser %>;
    var mailpoet_beacon_articles = [
      '57ce07ffc6979108399a044b',
      '57ce079f903360649f6e56fc',
      '5b16db842c7d3a0fa9a2aa15',
      '5d96ecd204286364bc8ff8f5',
      '58a5a7502c7d3a576d353c78',
      '5d0a1da404286318cac46fe5'
    ];
</script>
<% endblock %>


<% block translations %>
<%= 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'),
'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'),
}) %>
<% endblock %>
