From 951869109b9f8995db3f823b6cebe3f0aa0ceaae Mon Sep 17 00:00:00 2001 From: Krzysztof Kwasniak Date: Tue, 11 Jun 2024 13:17:22 +0200 Subject: [PATCH] Add information about USER_EMAIL_URL env variable --- .../app-store/legacy-plugins/user-emails.mdx | 16 ++++++++++++++++ docs/setup/configuration.mdx | 18 ++++++++++++++++++ .../app-store/legacy-plugins/user-emails.mdx | 16 ++++++++++++++++ .../version-3.x/setup/configuration.mdx | 18 ++++++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/docs/developer/app-store/legacy-plugins/user-emails.mdx b/docs/developer/app-store/legacy-plugins/user-emails.mdx index 7bfd260a0..597c9406f 100644 --- a/docs/developer/app-store/legacy-plugins/user-emails.mdx +++ b/docs/developer/app-store/legacy-plugins/user-emails.mdx @@ -12,6 +12,22 @@ If you plan on building a new integration with Saleor, we recommend using the [E After being called by [`PluginManager`](developer/extending/plugins/overview.mdx), the plugin will fill the template using event payload and send a message via SMTP. +## Configuration + +If the email configuration of the plugin on the dashboard side will be empty, the plugin will try to use variables defined in settings.py file: + +- `settings.USER_EMAIL_HOST` +- `settings.USER_EMAIL_PORT` +- `settings.USER_EMAIL_HOST_USER` +- `settings.USER_EMAIL_HOST_PASSWORD` +- `settings.USER_EMAIL_USE_TLS` +- `settings.USER_EMAIL_USE_SSL` + +### Note + +Alternatively those variables can be provided via [`USER_EMAIL_URL`](../../../setup/configuration.mdx#user_email_url) environment variable. +Plugin configuration values will override the environment variable values. + ## Available events - `account_confirmation` diff --git a/docs/setup/configuration.mdx b/docs/setup/configuration.mdx index 8508da433..1fe2a5aeb 100644 --- a/docs/setup/configuration.mdx +++ b/docs/setup/configuration.mdx @@ -164,6 +164,24 @@ Some examples: **Example:** `smtp://user:password@smtp.example.com:465/?ssl=True` +### `USER_EMAIL_URL` + +The URL used by [`UserEmails`](../developer/app-store/legacy-plugins/user-emails). + +Some examples: + +| Description | URL | +| ------------------------- | ----------------------------------------------------------------------------- | +| Amazon SES | `smtp://username:password@email-smtp.us-east-1.amazonaws.com:587/?tls=True` | +| Gmail | `smtp://my.gmail.username@gmail.com:my-password@smtp.gmail.com:465/?ssl=True` | +| Mailgun | `smtp://username:password@smtp.mailgun.org:465/?ssl=True` | +| Mailjet | `smtp://username:password@in-v3.mailjet.com:587/?tls=True` | +| OVH | `smtp://username@example.com:my-password@pro1.mail.ovh.net:587/?tls=True` | +| SendGrid | `smtp://apikey:your.api.key@smtp.sendgrid.com:465/?ssl=True` | +| A SMTP server unencrypted | `smtp://username@example.com:my-password@smtp.example.com:25/` | + +**Example:** `smtp://user:password@smtp.example.com:465/?ssl=True` + ### `FEDERATED_QUERY_MAX_ENTITIES` Sets upper limit on how many entities may be requested by Apollo Federation's gateway for a single GraphQL query. Defaults to `100`. Set to `0` to remove this limit. diff --git a/versioned_docs/version-3.x/developer/app-store/legacy-plugins/user-emails.mdx b/versioned_docs/version-3.x/developer/app-store/legacy-plugins/user-emails.mdx index 7bfd260a0..597c9406f 100644 --- a/versioned_docs/version-3.x/developer/app-store/legacy-plugins/user-emails.mdx +++ b/versioned_docs/version-3.x/developer/app-store/legacy-plugins/user-emails.mdx @@ -12,6 +12,22 @@ If you plan on building a new integration with Saleor, we recommend using the [E After being called by [`PluginManager`](developer/extending/plugins/overview.mdx), the plugin will fill the template using event payload and send a message via SMTP. +## Configuration + +If the email configuration of the plugin on the dashboard side will be empty, the plugin will try to use variables defined in settings.py file: + +- `settings.USER_EMAIL_HOST` +- `settings.USER_EMAIL_PORT` +- `settings.USER_EMAIL_HOST_USER` +- `settings.USER_EMAIL_HOST_PASSWORD` +- `settings.USER_EMAIL_USE_TLS` +- `settings.USER_EMAIL_USE_SSL` + +### Note + +Alternatively those variables can be provided via [`USER_EMAIL_URL`](../../../setup/configuration.mdx#user_email_url) environment variable. +Plugin configuration values will override the environment variable values. + ## Available events - `account_confirmation` diff --git a/versioned_docs/version-3.x/setup/configuration.mdx b/versioned_docs/version-3.x/setup/configuration.mdx index 8508da433..1fe2a5aeb 100644 --- a/versioned_docs/version-3.x/setup/configuration.mdx +++ b/versioned_docs/version-3.x/setup/configuration.mdx @@ -164,6 +164,24 @@ Some examples: **Example:** `smtp://user:password@smtp.example.com:465/?ssl=True` +### `USER_EMAIL_URL` + +The URL used by [`UserEmails`](../developer/app-store/legacy-plugins/user-emails). + +Some examples: + +| Description | URL | +| ------------------------- | ----------------------------------------------------------------------------- | +| Amazon SES | `smtp://username:password@email-smtp.us-east-1.amazonaws.com:587/?tls=True` | +| Gmail | `smtp://my.gmail.username@gmail.com:my-password@smtp.gmail.com:465/?ssl=True` | +| Mailgun | `smtp://username:password@smtp.mailgun.org:465/?ssl=True` | +| Mailjet | `smtp://username:password@in-v3.mailjet.com:587/?tls=True` | +| OVH | `smtp://username@example.com:my-password@pro1.mail.ovh.net:587/?tls=True` | +| SendGrid | `smtp://apikey:your.api.key@smtp.sendgrid.com:465/?ssl=True` | +| A SMTP server unencrypted | `smtp://username@example.com:my-password@smtp.example.com:25/` | + +**Example:** `smtp://user:password@smtp.example.com:465/?ssl=True` + ### `FEDERATED_QUERY_MAX_ENTITIES` Sets upper limit on how many entities may be requested by Apollo Federation's gateway for a single GraphQL query. Defaults to `100`. Set to `0` to remove this limit.