Postman – メールマーケティングのお供に。コマンドラインでメール一括配信
メールマーケティングは今でも有効です。スパムに判定される可能性はありますが、それでも他の手法に比べて非同期である点が相手の好きなタイミングで読めるため、ストレスがあまり高くありません。 大量のメールを一括送信する際に便利なソフトウェアがPostmanです。HTML/テキストテンプレートを使ってメールを配信できます。
Postmanのインストール
インストールはgo getでできます。
$ go get github.com/zachlatta/postman
これで準備は完了です。
Postmanの使い方
まずはコマンドヘルプから。
$ postman --help
Postman is a utility for sending batch emails.
Usage:
postman [flags]
Flags:
-csv path to csv of contact list
-debug print emails to stdout instead of sending
-html html template path
-password smtp password
-port port of smtp server
-sender email to send from
-server url of smtp server
-subject subject of email
-text text template path
-user smtp username
実際の使い方は次のようになります。
$ postman -html template.html -text template.txt -csv recipients.csv \
-sender "Zaphod Beeblebrox <zaphod @beeblebrox.com>" \
-subject "Hello, World!" -server smtp.beeblebrox.com -port 587 \
-user zaphod -password Betelgeuse123
Fromや件名は固定で、後は送り先をCSVで指定します。
$ cat recipients.csv
Email,Name,Type
atsushi@moongift.jp,Arthur Dent,Human
atsushi2@moongift.jp,Ford Prefect,Human
atsushi3@moongift.jp,Martin,Robot
atsushi4@moongift.jp,Trillian,Human
ヘッダーの部分がテンプレートで指定できます。
$ cat template.html
<h1>Hello, {{.Name}}! You are a {{.Type}}</h1>
後はバッチ処理で一気にメール配信するだけです。とても簡単に使えて、かつ送り先ごとに内容が変更できますのでより有効なメールマーケティングが実現できるでしょう。
PostmanはGo製、MIT Licenseのオープンソース・ソフトウェアです。