<% 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="title">
    <%= __('Import') %>
    <a class="page-title-action" 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"></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'),
'validationStepBlock3': __('Lists quickly start having invalid addresses because people change jobs and stop using their addresses. This is known as hard bounces and is a primary factor for detecting bad sending practices.'),
'validationStepBlock4': _x('If you send with MailPoet, we will quickly detect and suspend your account, even if you have just 5% of hard bounces.', 'Paragraph explaining the user how that MailPoet will ban users with list that have invalid email addresses'),
'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'),
'seeVideo': __(' See video guide'),
'importAgain': __('Import again'),
'viewSubscribers': __('View subscribers'),
'offerMigrationHead': __('Let a MailPoet expert help you for free'),
'offerMigrationSubhead': __('You have a nice list! Our amazing support team can help you, all for free, with the following'),
'offerMigrationList1': __('Review your list for best practices to ensure top deliverability'),
'offerMigrationList2': __('Review your Settings to make sure everything is set up correctly'),
'offerMigrationList3': __('Design a beautiful template that matches your brand'),
'offerMigrationList4': __('Review your forms to get more subscribers'),
'offerMigrationCTA': __('Contact us for free'),
'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"),
'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'),
'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?')
}) %>
<% endblock %>
