Answers.Body: <p>Yes it appears to be a bug.  You should file one. </p>
  
  <p>Here seems to be the conditions:</p>
  
  <p>Importing update or fill, i.e. contact already exists
  Has no existing email address or any existing has is_primary flag = 0
  Has a street address or are also importing one</p>
  
  <p>There seems to be no way via import to fix these or to import them correct.  Well, if you are also importing a street address, you can to do two imports, first just adding email address and second adding the address.  </p>
  
  <p>I guessing the design is for any new additional email address imports to not make them primary (makes sense) and for some reason the existence of a street address makes it think there is already an existing email address.</p>
  
  <p>Here is some sql that will give you back any contacts with email addresses that don't have primary one.  </p>
  
  <pre><code>select c.display_name,
         e.email,
         e.on_hold,
         e.is_primary,
         e.id eid,
         t.name,
         c.id cid,
  from   civicrm_contact c,
         civicrm_email e,
         civicrm_location_type t
  where  e.contact_id = c.id
  and    e.location_type_id = t.id
  and    not c.is_deleted
  and    not exists 
         (select 'email primary'
          from   civicrm_email e2
          where  e2.contact_id = e.contact_id
          and    e2.is_primary)
  order by 1
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-14T20:04:23.223Z
Answers.LastActivityDate: 2019-03-14T20:04:23.223Z
Answers.UserDisplayName: Paul-Tahoe
Answers.Body: <p>Use the API Explorer to see what you have in the field "Do not email".  Go to Support > Developer > API Explorer For Entity select Contact, leave Action as Get, Fields to Return select Do not Email (you can leave this blank and you will see all the fields). You can select a parameter so you get one or more of the imported contacts that is not working. Then below click Execute and you should see results. If the "Do not email" field is 0 then this will not be your problem. If it is 1 or Null then you need to add another column to your CSV file for "Do not Email" and set it to 0.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-12T11:21:49.420Z
Answers.Text: Unfortunately in my case "Do not email" field is "0"
Answers.UserDisplayName: Thinkwell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-12T12:39:33.503Z
Answers.Text: I'm only assuming this could likely be a bug since it also occurs on a clean install of the Civi demo site at https://civicrm.demo.civihosting.com
Answers.UserDisplayName: Thinkwell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-12T02:41:13.780Z
Answers.LastActivityDate: 2019-03-12T02:41:13.780Z
Answers.UserDisplayName: Iowa Boy
Answers.Body: <p>If you import the email address as type- Primary it will be available for mailings</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-11T11:04:22.860Z
Answers.Text: I have tried that - mapping the email field to "Email (match to contact)" and type "Primary" still does not make the email "active" for use
Answers.UserDisplayName: Thinkwell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-11T07:17:29.587Z
Answers.LastActivityDate: 2019-03-11T07:17:29.587Z
Answers.UserDisplayName: Craig Almond
Body: <p>If I import contacts via a CSV file and indicate a home email, the email address does get imported without any issue. </p>
  
  <p>However, in order to send an email to the contact (in my case sending to an entire group in CiviMail), I currently need to open the contact and select "Add or edit email", and re-save it in order for it to be active.</p>
  
  <p>Once it is active (which can be determined when the field label "Home Email" is then bolded), CiviMail then recognizes the email address and can then send.</p>
  
  <p><strong>Update: I should add, this could likely be a bug since the issue is also present on the Civi demo site at <a href="https://civicrm.demo.civihosting.com" rel="nofollow noreferrer">https://civicrm.demo.civihosting.com</a></strong></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-14T01:35:12.740Z
Comments.Text: I just tried to do a simple import (first, last, email) into the demo site above and it worked no problem.  The email address label is bolded, which I think means that email address has the is_primary field in the civicrm_email table set to 1.  I'm guessing for some reason this is not getting set right for you.  When you go to edit the email addresses, is the primary box checked? What is the structure of your csv file?  I seemed to remember one time where the order made a difference.  You might try having the email address be one of the first columns.
Comments.UserDisplayName: Paul-Tahoe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-14T12:58:09.453Z
Comments.Text: That method only seems to work if you previously added an email address (which would have automatically saved it as "Primary"), if there was already an email address it will update and keep the field title bold because it won't affect the "is_primary" status. If you create a new contact on the demo site, just add a First Name and Last Name and leave the email field blank, then import with an address field and you should be able to replicate.
Comments.UserDisplayName: Thinkwell
Tags: <civimail><email><groups><data-import><bug-reporting>
Title: Import Contacts with Email field issue
ThreadText: # Import Contacts with Email field issue
  
  (Asked by: username_0 on 2019-03-11)
  
  If I import contacts via a CSV file and indicate a home email, the email address does get imported without any issue.
  
  However, in order to send an email to the contact (in my case sending to an entire group in CiviMail), I currently need to open the contact and select "Add or edit email", and re-save it in order for it to be active.
  
  Once it is active (which can be determined when the field label "Home Email" is then bolded), CiviMail then recognizes the email address and can then send.
  
  **Update: I should add, this could likely be a bug since the issue is also present on the Civi demo site at <https://civicrm.demo.civihosting.com>**
  
  **Tags:** civimail, email, groups, data-import, bug-reporting
  
  > **Comments:**
  > **username_1**: I just tried to do a simple import (first, last, email) into the demo site above and it worked no problem.  The email address label is bolded, which I think means that email address has the is_primary field in the civicrm_email table set to 1.  I'm guessing for some reason this is not getting set right for you.  When you go to edit the email addresses, is the primary box checked? What is the structure of your csv file?  I seemed to remember one time where the order made a difference.  You might try having the email address be one of the first columns.  
  > **username_0**: That method only seems to work if you previously added an email address (which would have automatically saved it as "Primary"), if there was already an email address it will update and keep the field title bold because it won't affect the "is_primary" status. If you create a new contact on the demo site, just add a First Name and Last Name and leave the email field blank, then import with an address field and you should be able to replicate.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-03-14. Score: 1
  
  Yes it appears to be a bug.  You should file one. 
  Here seems to be the conditions:
  Importing update or fill, i.e. contact already exists
  Has no existing email address or any existing has is_primary flag = 0
  Has a street address or are also importing one
  There seems to be no way via import to fix these or to import them correct.  Well, if you are also importing a street address, you can to do two imports, first just adding email address and second adding the address.  
  I guessing the design is for any new additional email address imports to not make them primary (makes sense) and for some reason the existence of a street address makes it think there is already an existing email address.
  Here is some sql that will give you back any contacts with email addresses that don't have primary one.  
  select c.display_name,
         e.email,
         e.on_hold,
         e.is_primary,
         e.id eid,
         t.name,
         c.id cid,
  from   civicrm_contact c,
         civicrm_email e,
         civicrm_location_type t
  where  e.contact_id = c.id
  and    e.location_type_id = t.id
  and    not c.is_deleted
  and    not exists 
         (select 'email primary'
          from   civicrm_email e2
          where  e2.contact_id = e.contact_id
          and    e2.is_primary)
  order by 1
  
  
  ---
  
  ### Answer by username_2 on 2019-03-12. Score: 0
  
  Use the API Explorer to see what you have in the field "Do not email". Go to Support > Developer > API Explorer For Entity select Contact, leave Action as Get, Fields to Return select Do not Email (you can leave this blank and you will see all the fields). You can select a parameter so you get one or more of the imported contacts that is not working. Then below click Execute and you should see results. If the "Do not email" field is 0 then this will not be your problem. If it is 1 or Null then you need to add another column to your CSV file for "Do not Email" and set it to 0.
  
  > **Comments:**
  > **username_0**: Unfortunately in my case "Do not email" field is "0"  
  > **username_0**: I'm only assuming this could likely be a bug since it also occurs on a clean install of the Civi demo site at https://civicrm.demo.civihosting.com  
  
  ---
  
  ### Answer by username_3 on 2019-03-11. Score: 0
  
  If you import the email address as type- Primary it will be available for mailings
  
  > **Comments:**
  > **username_0**: I have tried that - mapping the email field to "Email (match to contact)" and type "Primary" still does not make the email "active" for use  
  
  ---
  
  