When syncing to UF record, use API instead of DAO to create email
authorAidan Saunders <aidan.saunders@squiffle.uk>
Mon, 10 Jun 2019 12:42:13 +0000 (13:42 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Mon, 10 Jun 2019 20:15:42 +0000 (21:15 +0100)
commit56e50a8b6c3e1240d78e3cb878c304f0d3011559
treec087c200dfac6245fdd38bb92723f6055db4b81e
parent2890c0f91eca7f45ad32c43823483efdd6e05264
When syncing to UF record, use API instead of DAO to create email
 - with the addition of a default location in this change, this fixes core#1026

Bonus code tidy: if UF email matches the contact primary email, avoid unnecessary update.
If update is needed, use API not direct SQL.
CRM/Core/BAO/UFMatch.php