Skip to content

Commit f5d1952

Browse files
authored
Update docs for SMTP config (#8535)
We were missing `name` and the instructions around setting the "current" provider.
1 parent 2d982f3 commit f5d1952

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

docs/reference/auth/index.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,38 @@ If you are having trouble receiving webhooks, you might need to look for any res
267267
Configuring SMTP
268268
================
269269

270-
For email-based factors, you can configure SMTP to allow the extension to send
271-
emails on your behalf. You should either configure SMTP, or webhooks for the
272-
relevant events.
273270

274-
Here is an example of configuring SMTP for local development, using something
275-
like `Mailpit <https://mailpit.axllent.org/docs/>`__.
271+
For email-based factors, you can configure SMTP to allow the extension to send emails on your behalf. You should either configure SMTP, or webhooks for the relevant events.
272+
273+
The easiest way to configure SMTP is to use the built-in UI. Here is an example of configuring SMTP for local development using EdgeQL directly, using something like `Mailpit <https://mailpit.axllent.org/docs/>`__.
274+
275+
.. note:: Gel Cloud users, rejoice!
276+
277+
If you are using Gel Cloud, you can use the built-in development SMTP provider without any configuration. This special provider is already configured for development usage and is ready to send emails while you are developing your application. This provider is tuned specifically for development: it is rate limited and the sender is hardcoded. Do not use it in production, it will not work for that purpose.
276278

277279
.. code-block:: edgeql
278280
279-
CONFIGURE CURRENT BRANCH INSERT cfg::SMTPProviderConfig {
281+
# Create a new SMTP provider:
282+
#
283+
configure current branch
284+
insert cfg::SMTPProviderConfig {
285+
# This name must be unique and is used to reference the provider
286+
name := 'local_mailpit',
280287
sender := 'hello@example.com',
281288
host := 'localhost',
282289
port := <int32>1025,
290+
username := 'smtpuser',
291+
password := 'smtppassword',
283292
security := 'STARTTLSOrPlainText',
284293
validate_certs := false,
285-
};
294+
timeout_per_email := <duration>'60 seconds',
295+
timeout_per_attempt := <duration>'15 seconds',
296+
};
297+
298+
# Set this provider as the current email provider by name:
299+
#
300+
configure current branch
301+
set current_email_provider_name := 'local_mailpit';
286302
287303
288304
Enabling authentication providers

0 commit comments

Comments
 (0)