jethro-pmm icon indicating copy to clipboard operation
jethro-pmm copied to clipboard

Add group members by email address

Open tbar0970 opened this issue 4 years ago • 1 comments

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

tbar0970 avatar Nov 16 '20 05:11 tbar0970

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;

tbar0970 avatar Nov 18 '20 02:11 tbar0970