SMTP App Configuration
You will need SMTP server credentials. Email templates are created using MJML language and can be edited in the app dashboard. Dynamic parts of the email (for example the number of the order) can be added using Handlebars. For more advanced template features you can use handlebars-helpers
Before you start - server credentials
Using this provider requires access to the SMTP server. Depending on your needs, you may use:
Creating configuration
- Open the SMTP app in Saleor Dashboard
- Click on
Add configuration
- Provide SMTP server credentials for your SMTP server
- Click on
Save provider
. The application will redirect automatically to the configuration details - Enter sender details, which will be displayed as the author of the emails for your customers. Click on
Save provider
- In the events section, choose which emails should be sent. You can also modify the template of the emails.
- Click on
Save provider
Now the application is configured and emails will be sent.
Testing
If you don't have access to the SMTP server, you can use an external service for testing, for example:
Both services provide a free plan that will allow you to test email delivery.
Both services have similar functionality. The following guide will use MailSlurp as an example.
- Create an account at MailSlurp
- Create a new inbox - documentation
- Choose
SMTP
as the inbox type - Choose
Virtual inbox
. This will create an inbox that captures all emails, so none will be sent to the original addressee - Configure the SMTP provider in the application:
- Fill SMTP server credentials form
- Use inbox address as sender email
More information can be found in the official guide.
Local development
If you are a developer working on EAM and don't want to use an external service, you can use MailHog, which comes pre-configured in this repository.
Requirements:
- Docker is installed
docker compose
command is available
To start the service:
- Open the EAM app folder in terminal
- Use the command
docker compose up
Mailhog will start the SMTP server and web interface. Now you can update provider configuration:
- Host:
localhost
- Port:
1025
- The rest can be left empty
All emails will be captured by the MailHog service. To inspect emails, open http://localhost:8025/
in your browser.