-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mail): add tip about overwriting view values
- Loading branch information
Showing
1 changed file
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,17 +151,39 @@ Any data that you provide using the `Mail` facade will be | |
available to you in your view: | ||
|
||
```html title="Path.views('mail/welcome.edge')" | ||
<!-- Provided by you also but using Mail facade --> | ||
<!-- Provided by you when using Mail facade methods --> | ||
<h1>{{ to }}</h1> | ||
<h1>{{ cc }}</h1> | ||
<h1>{{ bcc }}</h1> | ||
<h1>{{ from }}</h1> | ||
<h1>{{ content }}</h1> | ||
|
||
<!-- Provided by you in second argument --> | ||
<!-- Provided by you second argument --> | ||
<h1>{{ email }}</h1> | ||
``` | ||
|
||
:::tip | ||
|
||
You can overwrite data set by `Mail` facade by defining it | ||
in the second argument object: | ||
|
||
```typescript | ||
const userEmail = '[email protected]' | ||
|
||
await Mail.from('[email protected]') | ||
.to(userEmail) | ||
.cc('[email protected], [email protected]') | ||
.bcc('[email protected], [email protected]') | ||
.content('This is the mail body') | ||
.view('mail/welcome', { | ||
email: userEmail, | ||
to: '[email protected]' 👈 | ||
}) | ||
.send() | ||
``` | ||
|
||
::: | ||
|
||
### Previewing mail templates in the browser | ||
|
||
When designing a mailable's template, it is convenient to quickly | ||
|