This will make less work for the dedupe jobs, and possibly speed up imports.
We're already getting the contact_id on the query string. We shouldn't blindly trust that and overwrite an existing contact, so we'll need to include a hash too. Civicrm_contact has a 'hash' column.
- Export hash (as contact_hash)
- Add contact_hash to email links
- Pass contact_id and contact_hash through donatewiki and paymentswiki pipeline, add to messages
- paymentswiki should ONLY pass contact_id through to Civi if contact_hash is present and not empty/0/null
- Update import to look for contact_hash, and when that's present, only update the existing record if the hash is a match.
- Deal with contacts who have been merged since the email went out (if the deleted contact's id and hash match, update the merge target)