CiviMail has a great feature that finds intended recipients with the same email address prior to a mailing and prevents multiple emails getting sent to the same address. It seems similar to the Merge Address or Merge Household features in the Export action. Where in the code base is the CiviMail merge functionality located?
I'd like to create a similar function for CiviSMS and am looking for a starting point.
Based on the merge functions I've found in Export (https://github.com/civicrm/civicrm-core/blob/master/CRM/Export/BAO/Export.php), I've tried a few different searches on GitHub for the CiviMail merge function like "mergeemail" or "merge_email" but can't find anything yet.