saleor-apps-redis_apl/apps/emails-and-messages/docs/smtp.md

2.3 KiB

SMTP provider

To use this provider, you will need SMTP server credentials. Email templates are created using MJML language and can be edited in dashboard. Dynamic parts of the email (for example number of the order) can be added using Handlebars.

Before you start - server credentials

Using provider requires access to SMTP server. Depending on your needs, choose one of our recommendations.

For production environments

For testing

There are dedicated services for testing email delivery. One of them is Mailtrap.

Note

Such services capture emails and display it in their interface for inspection. Original addressee should not receive any message.

To get credentials needed to configuring the app, follow the guide.

For local development

If you are developer working on EAM and don't want to use 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 EAM app folder in terminal
  2. Use command docker compose up

Mailhog will start 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.

Creating configuration

  1. In the Saleor Dashboard navigate to the apps section
  2. Install Emails and Messages app
  3. After installation, click app name
  4. Click on Add provider
  5. Choose SMTP
  6. Provide SMTP server credentials created in previous step
  7. Click on Save provider
  8. Application will redirect automatically to the configuration details
  9. Enter sender details, which will be displayed as author of the emails for your customers
  10. Click on Save provider
  11. In the events section choose which of the emails should be sent. You can also modify template of the emails.
  12. Click on Save provider

Now application is configured and emails will be sent.