@smartperson/evershop-smtp
v1.0.1
Published
SMTP email service extension for EverShop — send transactional emails via any standard SMTP server
Maintainers
Readme
evershop-smtp
An EverShop extension that enables sending transactional emails (order confirmations, etc.) via a standard SMTP connection. Replaces the need for SendGrid/Mailgun/Resend.
Installation
Option A: Install from npm (recommended)
npm install @smartperson/evershop-smtpRegister it in your EverShop config (config/default.json):
{
"system": {
"extensions": [
// ... other extensions ...
{
"name": "smartperson_smtp",
"resolve": "node_modules/@smartperson/evershop-smtp",
"enabled": true,
"priority": 10
}
]
}
}Option B: Copy into extensions/
cp -r evershop-smtp /path/to/evershop/extensions/smartperson_smtp
cd /path/to/evershop/extensions/smartperson_smtp
npm install
npm run build{
"system": {
"extensions": [
{
"name": "smartperson_smtp",
"resolve": "extensions/smartperson_smtp",
"enabled": true,
"priority": 10
}
]
}
}Configuration
Configure SMTP settings under the smartperson_smtp key in your EverShop config table:
{
"shop": {...},
"system": {...},
"smartperson_smtp": {
"host": "smtp.gmail.com",
"port": 465,
"secure": true,
"auth": {
"user": "[email protected]",
"pass": "your-app-password"
},
"admin_bcc": ["[email protected]", "[email protected]"]
}
}NOTE: for credentials (host, username, password), we recommend adding them to your EverShop install's .env file instead. Any values in .env will override configuration/*.json values.
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_SECURE=true
[email protected]
SMTP_AUTH_PASS=your-app-passwordYou'll also need to set the sender address EverShop uses for notifications, under notification_emails.from in your config.
Configuration Options
host/SMTP_HOST— SMTP server hostnameport/SMTP_PORT— SMTP portsecure/SMTP_SECURE— Use TLS/SSL (true/false)auth.user/SMTP_AUTH_USER— Username for authenticationauth.pass/SMTP_AUTH_PASS— Password or app-specific password for authenticationadmin_bcc— single value or JSON list of admin email addresses to BCC on every email (optional). Use this to get an email sent to yourself (or any other store admins) for every action that generates an email. By default this includes user welcomes, user password resets, order confirmations, and possibly more.
Notes
- The extension uses nodemailer under the hood.
- If no SMTP config is provided, it falls back to a local SMTP server on port 587 (the nodemailer default).
- After enabling/disabling or changing config, rebuild your EverShop project:
npm run build.
License
MIT
