Skip to main content

SMTP setup

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

  1. Open the SMTP app in Saleor Dashboard
  2. Click on Add configuration
  3. Provide SMTP server credentials for your SMTP server
  4. Click on Save provider. The application will redirect automatically to the configuration details
  5. Enter sender details, which will be displayed as the author of the emails for your customers. Click on Save provider
  6. In the events section, choose which emails should be sent. You can also modify the template of the emails.
  7. 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.

tip

Both services have similar functionality. The following guide will use MailSlurp as an example.

  1. Create an account at MailSlurp
  2. Create a new inbox - documentation
  3. Choose SMTP as the inbox type
  4. Choose Virtual inbox. This will create an inbox that captures all emails, so none will be sent to the original addressee
  5. 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:

  1. Open the EAM app folder in terminal
  2. 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.