jethro-pmm
jethro-pmm copied to clipboard
Add group members by email address
It would be nifty to be able to take a list of email addresses and use it to quickly add people to a group; Open the group Click "add members by email address" Paste the list of emails Tickbox: "Also include family members of status [multi-choose] and age bracket [multi-choose]" It adds the persons and warns you if an email address doesn't match any person
Sample SQL
INSERT IGNORE INTO person_group_membership (personid, groupid, membership_status)
SELECT p.id, @groupid, pgms.id
FROM _person p
JOIN _person pp ON pp.familyid = p.familyid
JOIN person_group_membership_status pgms ON pgms.is_default=1
WHERE pp.email IN (...)
AND p.status NOT IN ('contact', 'archived')
GROUP BY p.id, @groupid;