# Email Setup SMTP configuration for sending email reminders to expected signers. ## Overview Ackify's email service allows sending automatic reminders to users who have not yet signed a document. **Features**: - Multilingual reminder sending (fr, en, es, de, it) - HTML and plain text templates - Send history in PostgreSQL - TLS/STARTTLS support - Configurable timeout **Note**: Email service is **optional**. If `ACKIFY_MAIL_HOST` is not defined, emails are disabled. ## Basic Configuration ### Required Variables ```bash # SMTP server ACKIFY_MAIL_HOST=smtp.gmail.com ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=your-email@gmail.com ACKIFY_MAIL_PASSWORD=your-app-password # Sender address ACKIFY_MAIL_FROM=noreply@company.com ``` ### Optional Variables ```bash # Displayed sender name (default: ACKIFY_ORGANISATION) ACKIFY_MAIL_FROM_NAME="Ackify - ACME Corporation" # Email subject prefix (optional) ACKIFY_MAIL_SUBJECT_PREFIX="[Ackify]" # Enable TLS (default: true) ACKIFY_MAIL_TLS=true # Enable STARTTLS (default: true) ACKIFY_MAIL_STARTTLS=true # Connection timeout (default: 10s) ACKIFY_MAIL_TIMEOUT=10s # Email template directory (default: templates/emails) ACKIFY_MAIL_TEMPLATE_DIR=templates/emails # Default email language/locale (default: en) # Supported: en, fr, es, de, it ACKIFY_MAIL_DEFAULT_LOCALE=en ``` ## Popular SMTP Providers ### Gmail **Configuration**: ```bash ACKIFY_MAIL_HOST=smtp.gmail.com ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=your-email@gmail.com ACKIFY_MAIL_PASSWORD=your-app-password ACKIFY_MAIL_TLS=true ACKIFY_MAIL_STARTTLS=true ``` **Prerequisites**: 1. Enable 2-step verification on your Google account 2. Generate an "App Password": https://myaccount.google.com/apppasswords 3. Use this password in `ACKIFY_MAIL_PASSWORD` ### SendGrid ```bash ACKIFY_MAIL_HOST=smtp.sendgrid.net ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=apikey ACKIFY_MAIL_PASSWORD=your-sendgrid-api-key ACKIFY_MAIL_FROM=noreply@your-domain.com ACKIFY_MAIL_TLS=true ``` ### Amazon SES ```bash ACKIFY_MAIL_HOST=email-smtp.us-east-1.amazonaws.com ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=your-smtp-username ACKIFY_MAIL_PASSWORD=your-smtp-password ACKIFY_MAIL_FROM=noreply@verified-domain.com ACKIFY_MAIL_TLS=true ``` **Important**: Verify your domain in AWS SES before sending. ### Mailgun ```bash ACKIFY_MAIL_HOST=smtp.mailgun.org ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=postmaster@your-domain.mailgun.org ACKIFY_MAIL_PASSWORD=your-mailgun-smtp-password ACKIFY_MAIL_FROM=noreply@your-domain.com ACKIFY_MAIL_TLS=true ``` ### Custom SMTP (Self-hosted) ```bash ACKIFY_MAIL_HOST=mail.company.com ACKIFY_MAIL_PORT=587 ACKIFY_MAIL_USERNAME=ackify@company.com ACKIFY_MAIL_PASSWORD=secure_password ACKIFY_MAIL_FROM=ackify@company.com ACKIFY_MAIL_TLS=true ACKIFY_MAIL_STARTTLS=true ``` ## Email Templates Templates are in `/backend/templates/emails/` with multilingual support. ### Structure ``` templates/emails/ ├── fr/ │ ├── reminder.html # French HTML template │ └── reminder.txt # French plain text template ├── en/ │ ├── reminder.html # English HTML template │ └── reminder.txt # English plain text template └── ... ``` ### Available Variables In templates, you can use: ```go {{.RecipientName}} // Recipient name {{.DocumentID}} // Document ID {{.DocumentTitle}} // Document title {{.DocumentURL}} // Document URL (if defined in metadata) {{.SignURL}} // URL to sign {{.OrganisationName}} // Organization name {{.SenderName}} // Sender name (admin) ``` ### HTML Template Example ```html
You are expected to sign the document {{.DocumentTitle}}.
Best regards,
{{.OrganisationName}}