Files
api_tmpl/internal/mailer/sender_test.go
FernandoJVideira c4ee0ce4dc chore: rename simple_bank to api_tmpl and clean up for template use
Rename the module, proto service, and all identifiers from simple_bank/
SimpleBank to api_tmpl/ApiTmpl, and regenerate the gRPC/gateway/swagger/
mock code accordingly.

- Scrub real secrets (SMTP password, auth token secret) from api.env/
  api_test.env, untrack them, and add api.env.example/api_test.env.example
- Remove committed build artifacts (tmp/main, tmp/build-errors.log,
  dbml-error.log) and gitignore them going forward
- Fix Dockerfile paths (build target, migrations copy) that referenced a
  stale project layout
- Rewrite README to match the actual cmd/ + internal/ structure and add a
  "using this as a template" section
2026-08-25 03:02:37 +01:00

33 lines
680 B
Go

package mailer
import (
"testing"
"github.com/FernandoJVideira/api_tmpl/internal/config"
"github.com/stretchr/testify/require"
)
func TestSendEmailWithGmail(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
config, err := config.LoadTestConfig("../..")
require.NoError(t, err)
sender := NewGmailSender(config.EmailSenderName, config.EmailSender, config.EmailPassword)
vars := struct {
ServiceName string
}{
ServiceName: "API Template",
}
to := []string{"[email protected]"}
attatchFiles := []string{"../README.md"}
err = sender.Send(TestEmailTemplate, vars, to, nil, nil, attatchFiles)
require.NoError(t, err)
}