Skip to content

Commit 3fede09

Browse files
authored
Merge pull request #570 from kenjis/fix-docs-add-config-email
docs: add configuration for Config\Email
2 parents ca7335c + 02c36a8 commit 3fede09

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

docs/install.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,31 @@ Require it with an explicit version constraint allowing its desired stability.
7373
php spark shield:setup
7474
```
7575

76+
2. Configure `app/Config/Email.php` to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
77+
78+
```php
79+
<?php
80+
81+
namespace Config;
82+
83+
use CodeIgniter\Config\BaseConfig;
84+
85+
class Email extends BaseConfig
86+
{
87+
/**
88+
* @var string
89+
*/
90+
public $fromEmail = '[email protected]';
91+
92+
/**
93+
* @var string
94+
*/
95+
public $fromName = 'your name';
96+
97+
// ...
98+
}
99+
```
100+
76101
### Manual Setup
77102

78103
There are a few setup items to do before you can start using Shield in
@@ -134,6 +159,31 @@ your project.
134159

135160
1. Use InnoDB, not MyISAM.
136161

162+
6. Configure `app/Config/Email.php` to allow Shield to send emails.
163+
164+
```php
165+
<?php
166+
167+
namespace Config;
168+
169+
use CodeIgniter\Config\BaseConfig;
170+
171+
class Email extends BaseConfig
172+
{
173+
/**
174+
* @var string
175+
*/
176+
public $fromEmail = '[email protected]';
177+
178+
/**
179+
* @var string
180+
*/
181+
public $fromName = 'your name';
182+
183+
// ...
184+
}
185+
```
186+
137187
## Controller Filters
138188
The [Controller Filters](https://codeigniter.com/user_guide/incoming/filters.html) you can use to protect your routes the shield provides are:
139189

docs/quickstart.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public int $unusedTokenLifetime = YEAR;
109109

110110
### Enable Account Activation via Email
111111

112+
> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
113+
112114
By default, once a user registers they have an active account that can be used. You can enable Shield's built-in, email-based activation flow within the `Auth` config file.
113115

114116
```php
@@ -120,6 +122,8 @@ public array $actions = [
120122

121123
### Enable Two-Factor Authentication
122124

125+
> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
126+
123127
Turned off by default, Shield's Email-based 2FA can be enabled by specifying the class to use in the `Auth` config file.
124128

125129
```php
@@ -131,6 +135,8 @@ public array $actions = [
131135

132136
### Responding to Magic Link Logins
133137

138+
> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
139+
134140
Magic Link logins allow a user that has forgotten their password to have an email sent with a unique, one-time login link. Once they've logged in you can decide how to respond. In some cases, you might want to redirect them to a special page where they must choose a new password. In other cases, you might simply want to display a one-time message prompting them to go to their account page and choose a new password.
135141

136142
#### Session Notification

0 commit comments

Comments
 (0)