saleor-apps-redis_apl/apps/emails-and-messages
Lukasz Ostrowski 1fd0960562
Release 2023-05-15
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-15 17:32:04 +02:00
..
graphql Replace export default with named exports (#352) 2023-04-05 20:27:23 +02:00
src Extract logger (#439) 2023-05-05 08:15:47 +02:00
.env.example Fix logs (#452) 2023-05-10 16:57:20 +02:00
.eslintrc Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
.graphqlrc.yml Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
.npmrc Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
CHANGELOG.md Release 2023-05-15 2023-05-15 17:32:04 +02:00
docker-compose.yml Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
next-env.d.ts Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
next.config.js Extract useDashboardNotification (#362) 2023-04-14 17:40:49 +02:00
package.json Release 2023-05-15 2023-05-15 17:32:04 +02:00
README.md Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
tsconfig.json Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00
turbo.json Change turborepo config to use local turbo.json (#353) 2023-04-13 12:44:27 +02:00
vitest.config.ts Add emails and messages app (#236) 2023-03-09 09:14:29 +01:00

Hero image

Emails and messages

What's included?

  • sending emails via SMTP
  • MJML template support
  • supported messages:
    • order
      • created
      • confirmed
      • cancelled
      • fully fulfilled
      • fully paid
    • invoice
      • sent

How to install

  • start local dev server or deploy the application
  • install the application in your Saleor Instance using manifest URL
  • configure the application in the dashboard

Learn more about Apps

Apps guide

Configuring apps in dashboard

Development

Requirements

Before you start, make sure you have installed:

  1. Install the dependencies by running:
pnpm install
  1. Start the local server with:
pnpm dev
  1. Expose local environment using tunnel:
  • Use Saleor CLI saleor app tunnel
  • Use tunneling tools like localtunnel or ngrok.
  1. Install application at your dashboard:

If you use Saleor Cloud or your local server is exposed, you can install your app by following this link:

[YOUR_SALEOR_DASHBOARD_URL]/apps/install?manifestUrl=[YOUR_APP_TUNNEL_MANIFEST_URL]

This template host manifest at /api/manifest

You can also install application using GQL or command line. Follow the guide how to install your app to learn more.

  1. Start the dev SMTP server
docker compose up

All emails will be captured by the MailHog service. To inspect emails, open http://localhost:8025/ in your browser.

Generated schema and typings

Commands build and dev would generate schema and typed functions using Saleor's GraphQL endpoint. Commit the 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 registration process Saleor API pass the auth token to the app. With this token App can query Saleor API with privileged access (depending on requested permissions during the installation). To store this data, app-template use a different APL interfaces.

The choice of the APL is done using APL environment variable. If 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.