Agent skill

Email System

by gjovanovicst in gjovanovicst/golang-auth-api

Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.

MITAuto-check passedBackend & APIs

Install Email System

skills CLI
$ npx skills add gjovanovicst/golang-auth-api --skill email-system -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gjovanovicst/golang-auth-api email-system --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gjovanovicst/golang-auth-api.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/email-system .claude/skills/email-system && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
email-system
GitHub stars
130
Token cost
~1.7k tokens
SKILL.md length
473 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.

  • Tasks that involve Transactional email
  • SKILL.md covers Architecture, Send Pipeline, Template Resolution Chain and SMTP Resolution Chain, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Authentication

What it does

Email System is an agent skill from gjovanovicst/golang-auth-api. Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Transactional email and Authentication. The repository describes itself as: A modern, production-ready Go REST API for authentication and authorization, featuring social login, email verification, JWT, and Redis integration. The licence is MIT.

When your agent uses it

  • Tasks that involve Transactional email
  • Tasks that involve Authentication

Example prompts

  • “/email-system”

What it can do on your machine

Read from SKILL.md and the folder at commit 795d18d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Email System loads about 1.7k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 473 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gjovanovicst/golang-auth-api at commit 795d18d, republished under its MIT licence (© gjovanovicst). 473 words, ~1,722 tokens.

Download SKILL.mdSave it as .claude/skills/email-system/SKILL.md (or your agent's skills folder).
name
email-system
description
Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.
license
MIT

Architecture

The email system is in internal/email/ and follows a multi-layered pipeline:

Service (orchestrator)
  |-- VariableResolver  -> resolves template variables from 4 sources
  |-- Renderer          -> renders templates with 3 supported engines
  |-- Sender            -> sends via SMTP (or logs in dev mode)
  |-- Repository        -> DB access for types, templates, server configs

Entry point: email.Service.SendEmailWithContext(appID, emailTypeCode, toEmail, userID, vars)

Send Pipeline

1. VariableResolver.ResolveVariables()  -- build final variable map
2. resolveTemplate()                     -- find the right template
3. Renderer.RenderTemplate()             -- render subject, HTML, text
4. resolveSMTPConfigForTemplate()        -- find the right SMTP config
5. Sender.Send()                         -- deliver via SMTP

Template Resolution Chain

Defined in internal/email/service.go method resolveTemplate:

1. DB: app-specific template
   WHERE app_id = ? AND email_type_id = ? AND is_active = true

2. DB: global default template
   WHERE app_id IS NULL AND email_type_id = ? AND is_active = true

3. Hardcoded fallback
   defaults.go -> GetDefaultTemplate(typeCode)

SMTP Resolution Chain

Defined in internal/email/service.go method resolveSMTPConfig:

1. DB: per-app config
   WHERE app_id = ? AND is_active = true AND is_default = true

2. DB: global config
   WHERE app_id IS NULL AND is_active = true AND is_default = true

3. Empty config -> dev/fallback mode (log to stdout)

With template override (resolveSMTPConfigForTemplate):

1. If template has ServerConfigID -> use that specific config by ID
2. Otherwise -> standard chain above
3. Apply template-level FromEmail/FromName overrides on top

Variable Resolution Pipeline

Defined in internal/email/resolver.go. Resolution priority (lowest to highest):

LayerSourceMethodExample Variables
1 (lowest)Static defaultsapplyStaticDefaultsDefaultValue from email_types.variables JSONB
2App/system settingsapplySettingsVarsapp_name, frontend_url
3User profileapplyUserVarsuser_email, user_name, first_name, last_name, locale, profile_picture
AlwaysFallback--user_email = toEmail if not set
4 (highest)Explicit caller varsdirect map copyverification_link, code, reset_link, etc.
Variable Sources
SourceVariablesHow Resolved
user (auto)user_email, user_name, first_name, last_name, locale, profile_pictureFrom DB user record
setting (auto)app_name, frontend_urlapp name from DB/env, frontend_url from env
explicit (caller)verification_link, verification_token, reset_link, code, expiration_minutes, change_time, magic_linkMust be passed by calling code

All variable constants are in internal/email/types.go.

Template Engines

Defined in internal/email/renderer.go:

EngineConstantSyntaxHTML Escaping
Go Templatego_template{{.AppName}} or {{.app_name}}Yes (automatic)
Placeholderplaceholder{app_name}No
Raw HTMLraw_html{{.AppName}}No (unsafe)

The renderer converts all variables to both snake_case and PascalCase forms, so templates can use either style.

Subject lines always use Go template syntax regardless of engine.

Email Types (7 built-in)

Constants in internal/email/types.go:

CodeConstantVariables Used
email_verificationTypeEmailVerificationapp_name, verification_link, user_email
password_resetTypePasswordResetapp_name, reset_link, expiration_minutes
two_fa_codeTypeTwoFACodeapp_name, code, expiration_minutes
welcomeTypeWelcomeapp_name, user_email
account_deactivatedTypeAccountDeactivatedapp_name, user_email
password_changedTypePasswordChangedapp_name, change_time, user_email
magic_linkTypeMagicLinkapp_name, magic_link, expiration_minutes

Default Templates

Defined in internal/email/defaults.go. All use go_template engine, provide both HTML and plain text bodies, and use responsive table-based layout with consistent styling (indigo #4f46e5 primary color, 600px max width).

Service Methods

Show full SKILL.md (190 more words)Show less
Typed Send Methods (in internal/email/service.go)
MethodEmail TypeExtra Vars
SendVerificationEmailemail_verificationverification_link (built from FRONTEND_URL + token)
SendPasswordResetEmailpassword_resetreset_link, expiration_minutes=60
Send2FACodeEmailtwo_fa_codecode, expiration_minutes=5
SendWelcomeEmailwelcome(none)
SendAccountDeactivatedEmailaccount_deactivated(none)
SendPasswordChangedEmailpassword_changedchange_time
SendMagicLinkEmailmagic_linkmagic_link, expiration_minutes=10
SendAdmin2FACodeEmailN/A (hardcoded HTML)Bypasses app-scoped resolution
SendAdminMagicLinkEmailN/A (hardcoded HTML)Bypasses app-scoped resolution
Management Methods

Template CRUD: GetTemplatesByApp, GetGlobalDefaultTemplates, GetTemplateByID, SaveAppTemplate, SaveGlobalTemplate, DeleteTemplate, ResetTemplateToDefault, PreviewTemplate

Email type CRUD: GetAllEmailTypes, GetEmailTypeByCode, CreateEmailType, UpdateEmailType, DeleteEmailType

Server config CRUD: GetServerConfig, SaveServerConfig, DeleteServerConfig, GetAllServerConfigs, etc.

SMTP Sending (internal/email/sender.go)

Uses gopkg.in/mail.v2.

Dev mode: If SMTP host is empty or "smtp.example.com", logs email to stdout (no error).

TLS handling:

  • Port 465: implicit SSL (d.SSL = true)
  • Other ports: MandatoryStartTLS, MinVersion TLS 1.2

Error behavior:

  • Send(): on SMTP failure, logs email as fallback and returns nil (email failure doesn't break business flow)
  • SendTest(): always returns errors (for admin testing)

Database Models

  • EmailType (pkg/models/email_type.go) -- types with variable definitions as JSONB
  • EmailTemplate (pkg/models/email_template.go) -- templates scoped to app or global
  • EmailServerConfig (pkg/models/email_server_config.go) -- SMTP configs scoped to app or global

When To Use This Skill

Load this skill when working on email sending, email templates, SMTP configuration, template variables, or any email-related feature.

© gjovanovicst, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/email-system of gjovanovicst/golang-auth-api.

Open the folder on GitHubat commit 795d18d

Compare with similar skills

Email System next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Email System compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Email System this skillgjovanovicst/golang-auth-api130—~1.7kAutomated safety check: PassMIT
Reading Mailcatcher APIbitwarden/ai-plugins155—~2.3kAutomated safety check: PassCustom licence
Configuration Messaginggreenpau/caddy-security2.3k—~1.6kAutomated safety check: PassApache-2.0
ResendLeoYeAI/openclaw-master-skills2.2k—~5.1kAutomated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Reading Mailcatcher API

    bitwarden/ai-plugins

    Official

    Retrieves a link from Mailcatcher. An agent skill from bitwarden/ai-plugins.

    155 GitHub stars~2.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Configuration Messaging

    greenpau/caddy-security

    Configure email and file messaging providers, SMTP transport, sender/authentication, templates, and registration delivery wiring.

    2.3k GitHub stars~1.6k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Resend

    LeoYeAI/openclaw-master-skills

    Resend API integration with managed authentication. An agent skill from LeoYeAI/openclaw-master-skills.

    2.2k GitHub stars~5.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed

More from gjovanovicst/golang-auth-api

  • Admin Gui

    gjovanovicst/golang-auth-api

    Documentation of the HTMX admin GUI including template rendering, session management, CRUD patterns, and the GUIHandler structure.

    130 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Auth Flows

    gjovanovicst/golang-auth-api

    Detailed documentation of the 4 authentication systems, token lifecycle, middleware pipeline, session management, and RBAC authorization.

    130 GitHub stars~2.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Data Model

    gjovanovicst/golang-auth-api

    All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.

    130 GitHub stars~2.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Project Map

    gjovanovicst/golang-auth-api

    Complete module inventory of the Auth API project with file paths, dependencies, and architecture overview.

    130 GitHub stars~2.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Route Map

    gjovanovicst/golang-auth-api

    Complete HTTP route structure with auth layers, middleware chains, rate limiting, and handler mappings for all API and GUI endpoints.

    130 GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Email System

What does Email System do?

Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates. Email System is an agent skill from gjovanovicst/golang-auth-api. Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.

When should I use Email System?

Email System fits situations like: tasks that involve Transactional email; tasks that involve Authentication.

How do I install Email System in Claude Code?

Run `npx skills add gjovanovicst/golang-auth-api --skill email-system -a claude-code`. Or copy the skill folder (.opencode/skills/email-system in gjovanovicst/golang-auth-api) into .claude/skills/email-system in your project. Claude Code loads it when a task matches its description.

How do I install Email System in Codex?

Run `npx skills add gjovanovicst/golang-auth-api --skill email-system -a codex`. Or copy the skill folder (.opencode/skills/email-system in gjovanovicst/golang-auth-api) into .agents/skills/email-system in your project. Codex loads it when a task matches its description.

Can I use Email System in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gjovanovicst/golang-auth-api --skill email-system -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/email-system, .gemini/skills/email-system, .github/skills/email-system and .opencode/skills/email-system in your project.

What does Email System need to run?

SKILL.md names no scripts, command-line tools or credentials: Email System is instructions for the agent only.

Does Email System access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Email System safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Email System use?

Email System is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Email System use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Email System?

Skills that share tags, products or a category with Email System: Reading Mailcatcher API (bitwarden/ai-plugins, 155 stars), Configuration Messaging (greenpau/caddy-security, 2.3k stars), Resend (LeoYeAI/openclaw-master-skills, 2.2k stars) and Fortify Development (coollabsio/coolify, 63k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Email System?

gjovanovicst (a GitHub user) maintains it in gjovanovicst/golang-auth-api, which has 130 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on July 30, 2026.

Source: gjovanovicst/golang-auth-api on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.