# Tooling for Simple but Informative Emails

DevFeed: [Tooling for Simple but Informative Emails](<https://devfeed.tech/articles/tooling-for-simple-but-informative-emails-41153.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2013/10/13/Tooling-for-Simple-but-Informative-Emails/>)

Author: Map

Published: 2013-10-13T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [Tooling](<https://devfeed.tech/topics/tooling.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [CSV](<https://devfeed.tech/topics/csv.md>), [email](<https://devfeed.tech/topics/email.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [csv](<https://devfeed.tech/tags/csv.md>), [email](<https://devfeed.tech/tags/email.md>), [gist](<https://devfeed.tech/tags/gist.md>), [github](<https://devfeed.tech/tags/github.md>), [hacks](<https://devfeed.tech/tags/hacks.md>), [password](<https://devfeed.tech/tags/password.md>), [script](<https://devfeed.tech/tags/script.md>), [sql](<https://devfeed.tech/tags/sql.md>), [tips](<https://devfeed.tech/tags/tips.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

## AI overview

A practical tutorial on sending concise, informative user emails with a simple script, using SQL to prepare recipient data and CSV to provide input.

## Source excerpt

Emails are one of my favorite methods of communicating with users. Its works as a quick test for product validation. It works well at one->some->many-> all. Its still highly effective even as much noise as we receive in our inboxes. Over the years I've tried a lot of email tools from custom built solutions, to newer entrants that help around drip actions (intercom.io and customer.io), to more "enterprise" tools such as Marketo. While I have varying opinions on all of those, I still find myself coming back to a simple one off script setup to deliver clear concise emails. Getting the Data The first step of any email is deciding what you want to do, but hopefully you know that already. The part that is usually a bit more effort is actually getting the list to send it to and formatting it appropriately. I usually opt for SQL. While the specifics of the query of course always vary it common follows a general structure: WITH initial_data AS ( SELECT email, app_name, information_about_app FROM users, apps WHERE users.id = apps.user_id AND some_filter_to_limit_data ), candidates_for_email AS ... --- likely to have additional CTEs --- Finally I build up the list SELECT email, array_to_string(array_agg(data_for_email), ' ') --- an important note is to add a newline or not here depending on how you wish to format it FROM candidates_for_email GROUP BY email; The query structure you'll want is first column email, second column whatever data you want to include in your email. From here I usually create a dataclip of it. This makes it easy to allow my data to change over time. If I'm testing an email for data over the last 7 days I just come back in 7 days and I have new data. It also lets me easily share and iterate on the data. The nice part is there's an easy way to click a button and get the data as a CSV which is what you want for sending. Once you download the CSV you'll want to remove the header line as its not needed for the script. Sending the Mail To actually send the em