Skip to content

Commit

Permalink
feat(mail): simplify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Mar 7, 2024
1 parent d2f90dc commit a134e82
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions docs/digging-deeper/mail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ file. However, you may use the `mailer()` method to send a message
using a specific mailer configuration:

```typescript
await Mail.mailer('my-mailer')
await Mail.mailer('my-mailer') πŸ‘ˆ
.from('[email protected]')
.to('[email protected]')
.text('Mail content')
Expand All @@ -115,7 +115,7 @@ method:
await Mail.mailer('my-mailer')
.from('[email protected]')
.to('[email protected]')
.html('<h1>Mail content</h1>')
.html('<h1>Mail content</h1>') πŸ‘ˆ
.send()
```

Expand All @@ -125,7 +125,7 @@ And for markdowns you can use the `markdown()` method:
await Mail.mailer('my-mailer')
.from('[email protected]')
.to('[email protected]')
.markdown('# Mail content')
.markdown('# Mail content') πŸ‘ˆ
.send()
```

Expand All @@ -140,7 +140,7 @@ const userEmail = '[email protected]'

await Mail.from('[email protected]')
.to(userEmail)
.view('mail/welcome', { email: userEmail })
.view('mail/welcome', { email: userEmail }) πŸ‘ˆ
.send()
```

Expand All @@ -149,20 +149,10 @@ await Mail.from('[email protected]')
When designing a mailable's template, it is convenient to quickly
preview the rendered mailable in your browser like a typical
Edge template. For this reason, Athenna allows you to return any
mailable directly from a route closure or controller by using the
`response.view()` method, allowing you to quickly preview its
design without needing to send it to an actual email address:
mailable directly from a route using the `Route.view()` method,
allowing you to quickly preview its design without needing to
send it to an actual email address:

```typescript title="Path.routes('http.ts')"
Route.get('/mailable', ({ response }) => {
return response.view('mail.welcome', { email: '[email protected]' })
})
Route.view('/mailable', 'mail.welcome', { email: '[email protected]' })
```








0 comments on commit a134e82

Please sign in to comment.