# If a contact changes email address (ie they move to a new Employer) - how to keep their history

**URL:** <https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004>\
**Category:** Product Support\
**Created:** [November 21, 2023, 12:35pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004 "2023-11-21T12:35:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![djuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/djuser/32/13229_2.png) [@djuser](https://forum.mautic.org/u/djuser)\
**Post date:** [November 21, 2023, 12:35pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004/1 "2023-11-21T12:35:09Z")

</div>

**Your software**  
My Mautic version is: 4  
My PHP version is: 8  
My Database type and version is: MySQL

**My problem**

I am new to Mautic this month. Or Contacts email addresses are all at-Work email addresses. In our CRM, when a Contact moved to a new Employer we change their email address and ALL the History is still in the CRM against them.

But - Mautic uses Email\_Address as a unique-key (This is my understanding so far).

So - how can we ensure that Mautic does not create a NEW contact - but keeps all the Mautic past history against the new email address?

**Steps I have tried to fix the problem:**  
I have searched the forums for an hour and not seen any help on this.

I do see in the forums that Mautic can have [more than email address per person -and will only send email to the main email](https://forum.mautic.org/t/allow-multiple-email-addresses-for-contact-i-e-secondary-addresses/20685/3) - so that may be a route to solve this

- copy their Old\_address to a secondary\_email field
- change their email to their New\_Email value.

**Another common Use Case - in some countries women change last\_name when they get married:**  
So they also will be the same Contact but a Changed email address.

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [November 21, 2023, 1:12pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004/2 "2023-11-21T13:12:59Z")

</div>

I think if you edit the record and change the email address the history will remain with the same contact as the other unique identifier is the contact ID.

If the new person completes an opt in form, for example, and uses a different email address then a new contact will be created.

---

<div class="post-metadata">

**Author:** ![djuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/djuser/32/13229_2.png) [@djuser](https://forum.mautic.org/u/djuser)\
**Post date:** [November 21, 2023, 5:24pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004/3 "2023-11-21T17:24:23Z")

</div>

Thanks @robm that’s helpful.

I will need to think how we achieve this: as the synch between our CRM and Mautic will at day 1 be based on ‘matching email address’: but after that we’ll need to handle:

- new contacts in the CRM - to sync to mautic as new contacts: on email address
- existing contacts in CRM - to sync to mautic; to update the email address but at the same Contact\_ID.

Have you achieved that kind of a setup OK ? Maybe it is more straight forward than I am imagining?

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [November 22, 2023, 7:11pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004/4 "2023-11-22T19:11:20Z")

</div>

if you doing this via api, you can retrieve the contact ID by querying on the old email address, then edit the contact based on the contact ID and add the new email address to that record.

I have this working in a sync between mautic and another system connected via an n8n workflow.

---

<div class="post-metadata">

**Author:** ![djuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/djuser/32/13229_2.png) [@djuser](https://forum.mautic.org/u/djuser)\
**Post date:** [November 23, 2023, 1:31pm UTC](https://forum.mautic.org/t/if-a-contact-changes-email-address-ie-they-move-to-a-new-employer-how-to-keep-their-history/30004/5 "2023-11-23T13:31:19Z")

</div>

Thanks @robm that’s very helpful.
