Last active
August 29, 2015 14:20
-
-
Save youngj/cdec35d1ab122b2f4556 to your computer and use it in GitHub Desktop.
List contacts in group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var group = project.getOrCreateGroup("Today Non-Respondents"); | |
var query = group.queryContacts({ | |
sort: 'name' | |
}); | |
var maxContacts = 1000; | |
var contacts = query.limit(maxContacts).all(); | |
var contactsInfo; | |
if (contacts.length) | |
{ | |
contactsInfo = contacts.map(function(c) { | |
return c.name; | |
}).join("\n"); | |
} | |
else | |
{ | |
contactsInfo = "No contacts found in "+group.name+"."; | |
} | |
sendEmail("admin@example.com", "Today Non-Respondents", contactsInfo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment