SP
B2B Doc Generator
Satu Persen Platform

Setup Guide

Panduan konfigurasi SMTP email dan domain.

System Status

Web App

Running (port 8005)

Domain

invoice.spcollective.id

SMTP Email

Checking...
1

Reload Nginx + SSL

Setup HTTPS untuk invoice.spcollective.id

Nginx config sudah di-install. Jalankan di terminal VPS:

sudo systemctl reload nginx
sudo certbot --nginx -d invoice.spcollective.id

Verifikasi:

curl -s -o /dev/null -w "%{http_code}" https://invoice.spcollective.id/
# Harus return 200
2

Buat Google App Password

Untuk partnership@satupersen.net

  1. 1 Login ke myaccount.google.com sebagai pemilik partnership@satupersen.net
  2. 2 Security > 2-Step Verification (harus aktif)
  3. 3 App Passwords > buat baru, nama: B2B Invoice
  4. 4 Copy 16-char password (format: xxxx xxxx xxxx xxxx)
3

Tambah SMTP ke .env

Konfigurasi credentials

Jalankan di terminal VPS (ganti PASSWORD):

cat >> /home/evan/.env << 'EOF'

# B2B Invoice SMTP
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=partnership@satupersen.net
SMTP_PASSWORD=PASTE_APP_PASSWORD_HERE
SMTP_FROM_NAME=Satu Persen Partnership
EOF

Ganti PASTE_APP_PASSWORD_HERE dengan App Password dari Step 2 (tanpa spasi).

4

Restart + Test

Verifikasi email bisa terkirim

Restart service:

systemctl --user restart b2b-invoice

Cek SMTP status:

curl -s http://localhost:8005/api/email/status
# Harus return: {"configured":true}

Jalankan full E2E test:

cd /home/evan/b2b-invoice-automation
source venv/bin/activate
python3 tests/test_email_e2e.py

Test akan generate invoice, kirim email ke partnership@satupersen.net, dan verifikasi via browser (Playwright).

5

Test Manual di Browser

Kirim email dari UI

  1. 1 Buka Generate Dokumen
  2. 2 Pilih Invoice > ERK, isi data klien (bebas, ini test)
  3. 3 Klik Generate Document
  4. 4 Di halaman result, isi email tujuan: partnership@satupersen.net
  5. 5 Klik Kirim Email > cek inbox

Troubleshooting

  • SMTP Auth Failed

    Pastikan App Password benar (16 karakter, tanpa spasi). 2-Step Verification harus aktif di akun Google.

  • Email Tidak Sampai

    Cek spam folder. Cek log: journalctl --user -u b2b-invoice -f

  • Certbot Gagal

    Pastikan port 80 terbuka dan DNS propagate: dig +short invoice.spcollective.id = 43.153.206.40