evershop-smtp
v1.0.2
Published
The evershop-smtp extension sends transactional emails for your EverShop store.
Maintainers
Readme
evershop-smtp
1. Overview
The evershop-smtp extension sends transactional emails for your EverShop store. For example, it sends order confirmations. The extension uses a standard SMTP connection. You do not need third-party services like SendGrid, Mailgun, or Resend. Internally, the extension uses nodemailer.
2. Installation
You can install the extension from npm or copy it to the local directory.
Install from npm
Run this command:
npm install evershop-smtpThen, add the extension to the config/default.json file:
{
"system": {
"extensions": [
{
"name": "evershop-smtp",
"resolve": "node_modules/evershop-smtp",
"enabled": true,
"priority": 10
}
]
}
}npm run build3. Configuration Options
You can set these values in config/default.json or in the .env file.
host/SMTP_HOST: The hostname of the SMTP server.port/SMTP_PORT: The port of the SMTP server 587 or 465.secure/SMTP_SECURE: Set this value totrueto use TLS or SSL for .auth.user/SMTP_AUTH_USER: The authentication username.auth.pass/SMTP_AUTH_PASS: The authentication password.admin_bcc: A single email address or a JSON list of admin email addresses. This is optional. The extension sends a BCC copy of every transactional email to these addresses. Transactional emails include user welcomes, password resets, and order confirmations.
4. Configuration Setup
Add the SMTP configuration to config/default.json:
{
"system": {
"smtp": {
"from": {
"name": "Online Store",
"address": "[email protected]"
},
"host": "your.smtp.host",
"port": 587, // set to 465 for SSL and 587 for TLS use secure false for TLS
"secure": false,
"auth": {
"user": "yoursmtp-user",
"pass": "yoursmtp-user-password"
},
"admin_bcc": [
"[email protected]", "[email protected]"
]
}
}Note: We recommend that you put credentials (host, username, password) in the .env file. Values in the .env file override values in the JSON files.
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465 or 587
SMTP_SECURE=true or false
[email protected]
SMTP_AUTH_PASS=your-smtp-passwordYou must also set the valid sender address for email notifications. Set the
smtp.from.addressvalue in the default.json or environment specific configuration json file.
If you do not provide an SMTP configuration, the extension uses a local SMTP server on port 587.
5. Build the Project
If you change the configuration, run npm run build to rebuild the EverShop project.
6. License
MIT Shahid
