Skip to content

Latest commit

 

History

History
 
 

smtp

Saleor App SMTP

SMTP application is responsible for sending emails and messages to customers. It is connected to the Saleor API via webhooks, which notify the application about the events. The messages are delivered by the SMTP protocol configured in the application

How to use this project

Requirements

Running app in development mode

  1. Install the dependencies by running the following command in the shell:
pnpm install
  1. Create a file named .env and use the contents of the .env.example file as a reference.

  2. Start the development server by running the following command in the shell:

pnpm dev
  1. SMTP app will be available under http://localhost:3000

  2. Tunnel the app by running:

ngrok http localhost:3000

Note

See How to tunnel an app for more info.

  1. Go to Dashboard, open the Apps tab and click Install external app, provide your tunnel URL with the path for the manifest file. For example ${YOUR_TUNNEL_URL}/api/manifest

Configuration

Here you can find doc how configure the app

Generated schema and typings

Commands build and dev would generate schema and typed functions using Saleor's GraphQL endpoint. Commit a generated folder to your repo as they are necessary for queries and keeping track of the schema changes.

Learn more about GraphQL code generation.

Storing registration data - APL

During the registration process, Saleor API passes the auth token to the app. With this token, the app can query Saleor API with privileged access (depending on permissions requested during installation). To store this data, the app-template uses a different APL interface.

The choice of the APL is done using the APL environment variable. If the value is not set, FileAPL is used. Available choices:

  • file: no additional setup is required. Good choice for local development. Can't be used for multi tenant-apps or be deployed (not intended for production)
  • upstash: use Upstash Redis as storage method. Free account required. Can be used for development and production and supports multi-tenancy. Requires UPSTASH_URL and UPSTASH_TOKEN environment variables to be set

If you want to use your own database, you can implement your own APL. Check the documentation to read more.

Learn more about Saleor Apps

Apps guide

Configuring apps in dashboard