Facebook Google+ Productivity Technology Twitter

Review a random Google Contact every day

I have all of my contacts loaded into Google Contacts but the problem is, I’m never convinced that they are up to date or even sure if I should still have the person’s contact details listed.

To address this I created the following script which will send me an email every day with a randomly selected contact.

I can then review the contact’s details, compare it with LinkedIn, Facebook and Twitter and then either update their contact details or send them an e-mail to catch up with them.

function reviewContacts() {
  var contacts=ContactsApp.getContacts()
  var contactCount=contacts.length
  var randID=Math.ceil(Math.random()*contactCount)
  var aContact=contacts[randID]
  var contactArray = aContact.getId().split('/')
  var contactID = contactArray[contactArray.length - 1]
  var contactName = aContact.getFullName()
  if (aContact.getCompanies().length > 0) {
    var companyName = aContact.getCompanies()[0].getCompanyName()
  else {
    var companyName = ""
  if (aContact.getEmails().length > 0){
    var emailAddress = aContact.getEmails()[0].getAddress()
  else {
    var emailAddress = ""
  var strMessage = 'Please review the contact information for ' + contactName + ' from ' +companyName +'.\n'
  strMessage += 'Send an email to: ' + emailAddress + '.\n'
  strMessage += 'Edit the contact' + contactID + ' ' + contactName + '.\n'
  strMessage += 'Search LinkedIn' + encodeURI(contactName) + '.\n'
  strMessage += 'Search Facebook' + encodeURI(contactName) + '.\n'
  strMessage += 'Search Twitter' + encodeURI(contactName) + '.\n'
  GmailApp.sendEmail(Session.getEffectiveUser().getEmail(), 'Review Contact - ' + contactName + ' from ' + companyName , strMessage);
//  UrlFetchApp.fetch("");

The script picks a random number, selects the contact associated with that number and formats an email with actionable links embedded within it.

I then create a trigger to run this script once per day at lunch time, allowing me to review the contents whilst I’m having my lunch.

See also this post for a similar search but built into Microsoft Outlook.

Leave a Reply

Your email address will not be published. Required fields are marked *