Importing Multiple Email Addresses and Phone Numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krisk
    Member
    • Dec 2015
    • 44

    Importing Multiple Email Addresses and Phone Numbers

    Please consider adding the capability to import and export multiple email addresses and phone numbers for a single account, contact, and/or lead. For example, importing accounts data from an uploaded csv file containing primary / secondary email addresses and office / mobile numbers for a particular account. I've tried to do this using the ["content1","content2","content3"] method recommended for importing to multiple enum fields, but that method doesn't seem to work for multiple email address or phone number fields.

    Thanks.
  • yuri
    Member
    • Mar 2014
    • 8438

    #2
    Importing mulitple Phone numbers is already implemented. Exporting phone numbers can achieved with easy customization in Record service of needed entity.

    PHP Code:
    
        protected $exportAdditionalFieldList = ['phoneNumberOffice'];
    
        public function loadAdditionalFieldsForExport(\Espo\ORM\Entity $entity)
        {
            parent::loadAdditionalFieldsForExport($entity);
            $this->loadPhoneNumberField($entity);
        }
    
        protected function getFieldPhoneNumberOfficeFromEntityForExport(\Espo\ORM\Entity $entity)
        {
            $phoneNumberData = $entity->get('phoneNumberData');
            foreach ($phoneNumberData as $d) {
                if ($d->type == 'Office') {
                    return $d->phoneNumber;
                }
            }
            return '';
        } 
    
    You can add other phone types.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • Riad
      Riad commented
      Editing a comment
      Hi,
      How to that with lead in crm version 7.1.9?
      Thank you
  • krisk
    Member
    • Dec 2015
    • 44

    #3
    Thanks. I understand now how to do the multiple phone number imports and will attempt to customize the code for the exports. What is the file path to the Record service of each entity where the additional code should go -- for example Accounts? How difficult would it be to add multiple email importing capability? For example, mapping to emailPrimary and emailSecondary categories, so you could import a primary and a secondary email address for a given entity. Thanks again.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8438

      #4
      You can create service in custom dir custom/Espo/Custom/Services/Account.php

      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • krisk
        Member
        • Dec 2015
        • 44

        #5
        Thank you. By the way, nice job on the 4.0.0 release.

        Comment

        • SpeedBullet
          Senior Member
          • Mar 2016
          • 123

          #6
          Originally posted by krisk
          Thanks. I understand now how to do the multiple phone number imports and will attempt to customize the code for the exports. What is the file path to the Record service of each entity where the additional code should go -- for example Accounts? How difficult would it be to add multiple email importing capability? For example, mapping to emailPrimary and emailSecondary categories, so you could import a primary and a secondary email address for a given entity. Thanks again.
          Hi, can you elaborate on how you make the program import multiple email addresses? I can only manage to import one email address (the last one that I select). Or do they have to be in the same column? How do they have to be separated?
          Last edited by SpeedBullet; 05-26-2016, 03:28 PM.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8438

            #7
            They must be in separate columns. Did you try to map specific phone type for columns?
            Phone (Office), Phone (Mobile)
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • SpeedBullet
              Senior Member
              • Mar 2016
              • 123

              #8
              Originally posted by yurikuzn
              They must be in separate columns. Did you try to map specific phone type for columns?
              Phone (Office), Phone (Mobile)
              Phones import but multiple emailaddresses don't.

              Comment

              • rodrigocoelho
                Active Community Member
                • Jun 2016
                • 296

                #9
                same problem here. I need to import different email address. Similar to the phone feature. Is that possible?

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8438

                  #10
                  Now it's not supported.
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • tobias
                    Senior Member
                    • May 2016
                    • 229

                    #11
                    Hi there, any news regarding the possibility to import multiple e-mail addresses?

                    We (Advanced Pack User) would really need this.

                    Comment

                    • Riad
                      Member
                      • Aug 2018
                      • 31

                      #12
                      Hi, I add the php code but still not export the second phone number. Espocrm v. 7.1.9

                      Comment

                      • Ashif Malayil
                        Senior Member
                        • Dec 2023
                        • 171

                        #13
                        Originally posted by yuri
                        You can create service in custom dir custom/Espo/Custom/Services/Account.php
                        Can you brief these steps once? I am getting error 500 after adding this file. This will be a great feature for us.

                        Comment

                        Working...