Skip to content

Commit

Permalink
update docs with new names
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Jan 7, 2025
1 parent 3eceb59 commit d529dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smtp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Depends on [klite-i18n](../i18n) for translations.

To use it, initialize the correct implementation when creating the Server instance:
```kotlin
register(if (Config.isDev) FakeEmailService::class else RealEmailService::class)
register(if (Config.isDev) FakeEmailSender::class else SmtpEmailSender::class)
```

Add approprate content to your translation files, e.g. `en.json`:
Expand All @@ -24,7 +24,7 @@ Add approprate content to your translation files, e.g. `en.json`:

Then you can send emails like this:
```kotlin
emailService.send(Email("[email protected]"), EmailContent("en", "welcome", mapOf("name" to "John"), URI("https://github.com/login")))
emailSender.send(Email("[email protected]"), EmailContent("en", "welcome", mapOf("name" to "John"), URI("https://github.com/login")))
```

You can redefine HTML email template by extending `EmailContent` class.

0 comments on commit d529dd7

Please sign in to comment.