5065 comments
2219 subscribers
4799 on Twitter
Subscribe! Feed reader E-mail

Personal contact relationship management

It’s a good thing that computer geeks appreciate automation. They can
sniff out form e-mail in seconds, but they don’t mind as long as it
comes from a very clever technical hack. Such was the case with the
form letter engine I put together just in time to ask people for their
postal addresses for my holiday updates. Paul Lussier wanted to know what kind of Emacs Lisp magic I was doing
behind the scenes. Simon Ditner got his
revenge by obfuscating his reply with 1337sp34|<. People humored me and replied with their addresses and birthdays, knowing that although the e-mail they got may have been mostly automated, my interest in them and my replies to the replies they sent me were very much real.

Good magicians never reveal their tricks, but I like talking about the
crazy Emacs wizardry that goes on behind the scenes. Let me lift the
curtain:

(concat
 "Hello, " (or (bbdb-record-getprop record 'nick) (bbdb-record-name record)) "!

I've actually managed to write my 2006 life update / holiday
letter somewhat in time, and will be mailing them out soon. I'd
love to find out how your year has been and what you're planning
to do next year, and I'd be happy to keep you up to date too!

"

(cond
 ((= (length (bbdb-record-addresses record)) 1)
  (concat "Is this address the best one to reach you at?\n\n"
          (sacha/bbdb-address-string (car (bbdb-record-addresses record)))))
 ((> (length (bbdb-record-addresses record)) 1)
  (concat "Which of these addresses is the best one to reach you at?\n\n"
          (mapconcat 'sacha/bbdb-address-string (bbdb-record-addresses record) "\n")))
 (t "I don't seem to have a mailing address for you, though. I'd
like to be able to snail-mail you postcards or holiday updates.
I promise not to use your address for anything evil! =) What's the best
way to send something to you?"))

(if (bbdb-record-getprop record 'birthdate)
    ""
  "\n\nBy the way, when is your birthday?")
"\n\nHope to hear from you soon!

Sacha Chua

p.s. No kittens were harmed in the writing of this message.")

That’s the source for my form letter – a Lisp expression, allowing me
to use the full power of Emacs. I used that as the input to the
following function:

(defun sacha/gnus-send-message-to-all (subject &optional text)
  "Compose message to everyone, with notes.
SUBJECT is a string.
TEXT is a string or an arbitrary Lisp expression starting with (."
  (interactive
   (list (read-string "Subject: ")
         (read-string "Body: ")))
  (let ((records bbdb-records))
    (while records
      (when (bbdb-record-net (caar records))
        (bbdb-send-mail (caar records) subject)
        (goto-char (point-min))
        (re-search-forward "--text " nil t)
        (forward-line 1)
        (let ((record (caar records)))
          (when text
            (insert (if (= (aref text 0) ?\() (eval (read text)) text))))
        (when (bbdb-record-notes (caar records))
          (save-excursion
            (insert "\n--- NOTES ---\n"
                    (bbdb-record-notes (caar records))
                    "\n--- END NOTES ---\n"))))
      (setq records (cdr records)))))

The function composed a message for each of the records currently
displayed. I edited the messages by hand, combining messages where
appropriate, and sent them off.

What else can I do with this? Because this function accepts arbitrary
Lisp expressions, it would be really easy to include a random
holiday-related greeting or poem. If I had a database of significant
events, I can include a random factoid about the recipient’s birthday.
If I had a local database of people’s names, I could send one-off
messages including the meaning of their names.

Yes, it’s pretty crazy, but that’s what you get when you have a geek
who cares about connecting with people. I’ve stolen all the cool
features from the contact relationship management systems I know
about, and I keep trying out more ideas. It’s a pity that the base
system I’m working on can be quite intimidating. If I found the time
to learn enough, say, Microsoft Outlook programming to implement a
similar system, I think I’d have quite a market.

Even with my idiosyncratic setup, though, it’s fun pushing the
envelope. =) There are a lot of other things I’d like to add, and I
don’t think I’ll ever stop coming up with new ideas. In terms of
personal contact relationship management, I’ve got one of the most
advanced systems I know—which just means I need to get to know more
people, so that I can find other inspirations!

On Technorati: , ,

Random Emacs symbol: previous-buffer – Command: Switch to the previous buffer in cyclic order.

Short URL: http://sachachua.com/blog/p/4064

Comment, share a thought, ask a question...

Please comment as you, not your organization.





 

On This Day...

  • 2011: Quantified Awesome: Thinking about what I want to build next — One of the best ways to make the most of those little pockets of time is to keep a someday [...]
  • 2010: Happy Holidays, Eh! First edition greeting card giveaway — Skip my VistaPrint review and go straight to the giveaway Last week, I thought: hey, what would a Canadian Christmas [...]
  • 2009: Notes from VizThink video on Visual Notetaking 101 — Click on the image to view a larger version. Next actions: Post notes Practice with podcasts, webcasts, books, and teleconferences [...]
  • 2008: Drupal and return on sharing — Another IBMer sent me an instant message out of the blue and introduced himself as a fellow Drupal developer. I [...]
  • 2008: Drupal: Changing module behavior without changing the source code — For the project I’m currently working on, I’m not allowed to make any changes to third-party source code. Yes, I’ve [...]
  • 2008: Twitter, Whuffie, and Amazing Connections — Thanks to Don Marti’s post about a possible business model for Twitter, I came across Tara Hunt’s post about Twitter, [...]
  • 2007: The evils of blur — I left my purse at the Bay food court at around 1:30 this afternoon. When I realized this at 5:00, I [...]
  • 2007: Story: Connecting through social computing — Let me tell you about a recent example of how social computing can help us form better relationships with our [...]
  • 2006: 50 e-mail messages today — Okay, my fingers are tired. No more e-mail. =) Someday I’m going to have to learn how to scale, but today [...]
  • 2006: Inbox meter — I should have one of those almost-real-time inbox meters that count the number of messages I’ve promised to respond to. That [...]
  • 2006: Found my vertical: HR — I ran into Pete Forde at Andrew Burke‘s birthday party last night. He explained to a number of Andrew’s friends in other [...]
  • 2006: Programming competitions — I always love reading Didith Rodrigo’s blog posts about programming competitions and my alma mater, Ateneo de Manila University. Her [...]
  • 2005: Scrabble — In between review sessions for my final exam tomorrow, I managed to play Scrabble with Steve (Biology) and Mike (Math). Much [...]
  • 2004: On the Map — http://www.onthemap.com.ph : street-level Flash-based map site for the Philippines. Nifty. Thanks to Dominique for the link!
  • 2004: Novell Linux-Certified Professional — Dominique‘s the first Novell Linux-Certified Professional in the Philippines. He doesn’t want to gloat on his blog. I, however, can gloat all [...]
  • 2003: Game development in Japan — Hee Soo Lee’s thinking of going for game development in Japan. Way cool. =) E-Mail from Soo Lee
  • 2003: Software Elegance — Gerald Generoso says You might wanna check this out —>> http://www.eskimo.com/~scs/readings/software_elegance.html E-Mail from apache
  • 2003: Printer works again — Apparently, they made it a printer server. Yay!