0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

朝イチ5分で差をつけろ!SES営業が今日から使える「自動化スクリプト」超入門

Posted at

1. はじめに

おはようございます!本記事ではSES営業や若手エンジニアの皆さんが、毎日の業務を“5分で劇的に効率化”できる自動化スクリプトの作り方を解説します。Python初心者でもOK、日報や顧客フォローが驚くほどラクになりますよ👍

2. 本記事でつくるもの

  • PythonとZapierを組み合わせて「日報自動生成&顧客フォローBot」を作ります。
  • Googleスプレッドシートを使い、入力内容を自動で整理し、Zapier経由でGmail送信まで自動化!

【完成イメージ】

上記のように、スプレッドシート→Python→Zapier→Gmailの流れで、日報や顧客フォローが自動化されます!

3. 事前準備

必要なツール&アカウント

セットアップ手順

  1. Pythonをインストール
  2. Zapierで無料アカウント作成
  3. Googleアカウントでスプレッドシートを用意

4. ステップバイステップ

4.1 仮想環境の作成

python -m venv venv
source venv/bin/activate
pip install requests gspread oauth2client

4.2 Google Sheets API 認証ファイルの配置

  • Google Cloud Consoleでプロジェクト作成
  • Sheets API有効化&サービスアカウント作成
  • 認証JSONファイル(例:credentials.json)をプロジェクト直下に配置
  • サービスアカウントのメールアドレスをGoogleスプレッドシートの共有に追加

4.3 スクリプト全文(50行前後)

import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime

# スプレッドシートAPI認証
scope = [
    'https://spreadsheets.google.com/feeds',
    'https://www.googleapis.com/auth/drive'
]
creds = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', scope)
client = gspread.authorize(creds)

# シートを開く
sheet = client.open('SES営業日報').sheet1

# 日報データを取得
today = datetime.now().strftime('%Y-%m-%d')
rows = sheet.get_all_records()

# 今日の日報を抽出
todays_reports = [r for r in rows if r['日付'] == today]

# 顧客ごとにメール文を作成
for report in todays_reports:
    name = report['顧客名']
    summary = report['対応内容']
    mail = f"""
{name}様

本日のご対応内容:
{summary}

ご不明点があればご連絡ください。
---
SES営業部
"""
    print(mail)
# Zapier WebhookでこのデータをPOSTし、Gmail送信まで自動化できます!

4.4 Zapierで “Webhooks → Gmail” のZapを作成

  • Zapierで「Webhooks by Zap」→「Gmail」のZapを作成
  • Webhook URLをPythonスクリプトに設定し、POSTでデータ送信
  • Gmailのテンプレートを設定し、受信したデータで自動送信

5. 動かしてみる

  • スクリプトを実行すると、日報データが自動でメール文に変換されます
  • ZapierのZapが受信し、Gmail経由で顧客に自動送信!

【実際の稼働イメージ】

上記のように、ユーザーの入力からメール送信までが全自動で流れます!


よくあるハマりポイント

  • Google Sheets APIの認証失敗 → サービスアカウントの共有権限を再確認
  • 文字コードエラー → ファイル保存時はUTF-8を指定
  • Zapier無料版の制限 → トリガー回数やGmail連携数に注意

まとめ & さらなる拡張アイデア

  • Slack通知やLINE通知に拡張
  • 顧客リスト自動更新や単価シミュレーションBot化
  • 毎朝自動実行で「朝イチ5分」ルーティンを実現

参考リンク


0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?