Skip to content

Commit 8ba0a69

Browse files
committed
Adding email address hooks docs
Documenting new hooks related to email address overrides. ExpressionEngine/ExpressionEngine#4805
1 parent 32046ed commit 8ba0a69

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

docs/development/extension-hooks/cp/login.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ How it's called:
5454

5555
$this->extensions->call('cp_member_logout');
5656
if ($this->extensions->end_script === TRUE) return;
57-
57+
5858
## `cp_member_reset_password()`
5959

6060
| Parameter | Type |
@@ -67,3 +67,24 @@ How it's called:
6767

6868
$this->extensions->call('cp_member_process_reset_password');
6969
if ($this->extensions->end_script === TRUE) return;
70+
71+
## `cp_member_send_reset_token_start($address)`
72+
73+
| Parameter | Type | Description
74+
| --------- | -------- | ---------------------------------------------------------------
75+
| $address | `String` | Email address posted from the control panel reset password form
76+
| Returns | `String` | Email address after extension processes it
77+
78+
Additional processing of email address sent via control panel reset password form.
79+
80+
How it's called:
81+
82+
```
83+
if (ee()->extensions->active_hook('member_auth_send_reset_token_start')) {
84+
$address = ee()->extensions->call('member_auth_send_reset_token_start', $address);
85+
if (ee()->extensions->end_script === true) {
86+
return;
87+
}
88+
}
89+
```
90+

docs/development/extension-hooks/global/email.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,47 @@ lang: php
1313

1414
# Email Library Extension Hooks
1515

16+
## `email_from_address($from, $name)`
17+
18+
| Parameter | Type | Description
19+
| --------- | -------- | --------------------------------------
20+
| $from | `String` | Email `from` address
21+
| $name | `String` | Email `name` for `from` address
22+
| Returns | `String` | Manipulated Email `from` address
23+
24+
Overwrite an email `from` address.
25+
26+
How it's called:
27+
28+
```
29+
if (ee()->extensions->active_hook('email_from_address')) {
30+
$from = ee()->extensions->call('email_from_address', $from, $name);
31+
}
32+
```
33+
34+
## `email_to_address($to)`
35+
36+
| Parameter | Type | Description
37+
| --------- | -------- | --------------------------------------
38+
| $to | `String` | Email `from` address
39+
| Returns | `String` | Manipulated Email `to` address
40+
41+
Overwrite an email `to` address.
42+
43+
How it's called:
44+
45+
```
46+
if (ee()->extensions->active_hook('email_to_address')) {
47+
$to = ee()->extensions->call('email_to_address', $to);
48+
}
49+
```
50+
51+
1652
## `email_send(&$data)`
1753

54+
55+
56+
1857
| Parameter | Type | Description |
1958
| --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2059
| &\$data | `Array` | Array of data about email to be sent (see above) passed [by reference](https://php.net/manual/en/language.references.pass.php) so data may be altered without needing to return the altered data |

docs/development/extension-hooks/module/member-auth.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,27 @@ How it's called:
6969
$edata = ee()->extensions->call('member_member_logout');
7070
if (ee()->extensions->end_script === TRUE) return;
7171

72+
## `member_auth_send_reset_token_start($address)`
73+
74+
| Parameter | Type | Description
75+
| --------- | -------- | ---------------------------------------------
76+
| $address | `String` | Email address posted from reset password form
77+
| Returns | `String` | Email address after extension processes it
78+
79+
Additional processing of email address sent via reset password form. Happens after basic security checks, but before email address check occurs.
80+
81+
How it's called:
82+
83+
```
84+
if (ee()->extensions->active_hook('member_auth_send_reset_token_start')) {
85+
$address = ee()->extensions->call('member_auth_send_reset_token_start', $address);
86+
if (ee()->extensions->end_script === true) {
87+
return;
88+
}
89+
}
90+
```
91+
92+
7293
## `member_process_reset_password()`
7394

7495
| Parameter | Type | Description |

0 commit comments

Comments
 (0)