Skip to content

Adding email address hooks docs #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 7.dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/development/extension-hooks/cp/login.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ How it's called:

$this->extensions->call('cp_member_logout');
if ($this->extensions->end_script === TRUE) return;

## `cp_member_reset_password()`

| Parameter | Type |
Expand All @@ -67,3 +67,22 @@ How it's called:

$this->extensions->call('cp_member_process_reset_password');
if ($this->extensions->end_script === TRUE) return;

## `cp_member_send_reset_token_start($address)`

| Parameter | Type | Description
| --------- | -------- | ---------------------------------------------------------------
| $address | `String` | Email address posted from the control panel reset password form
| Returns | `String` | Email address after extension processes it

Additional processing of email address sent via control panel reset password form.

How it's called:

if (ee()->extensions->active_hook('member_auth_send_reset_token_start')) {
$address = ee()->extensions->call('member_auth_send_reset_token_start', $address);
if (ee()->extensions->end_script === true) {
return;
}
}

32 changes: 32 additions & 0 deletions docs/development/extension-hooks/global/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,40 @@ lang: php

# Email Library Extension Hooks

## `email_from_address($from, $name)`

| Parameter | Type | Description
| --------- | -------- | --------------------------------------
| $from | `String` | Email `from` address
| $name | `String` | Email `name` for `from` address
| Returns | `String` | Manipulated Email `from` address

Overwrite an email `from` address.

How it's called:

if (ee()->extensions->active_hook('email_from_address')) {
$from = ee()->extensions->call('email_from_address', $from, $name);
}

## `email_to_address($to)`

| Parameter | Type | Description
| --------- | -------- | --------------------------------------
| $to | `String` | Email `from` address
| Returns | `String` | Manipulated Email `to` address

Overwrite an email `to` address.

How it's called:

if (ee()->extensions->active_hook('email_to_address')) {
$to = ee()->extensions->call('email_to_address', $to);
}

## `email_send(&$data)`


| Parameter | Type | Description |
| --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| &\$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 |
Expand Down
18 changes: 18 additions & 0 deletions docs/development/extension-hooks/module/member-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ How it's called:
$edata = ee()->extensions->call('member_member_logout');
if (ee()->extensions->end_script === TRUE) return;

## `member_auth_send_reset_token_start($address)`

| Parameter | Type | Description
| --------- | -------- | ---------------------------------------------
| $address | `String` | Email address posted from reset password form
| Returns | `String` | Email address after extension processes it

Additional processing of email address sent via reset password form. Happens after basic security checks, but before email address check occurs.

How it's called:

if (ee()->extensions->active_hook('member_auth_send_reset_token_start')) {
$address = ee()->extensions->call('member_auth_send_reset_token_start', $address);
if (ee()->extensions->end_script === true) {
return;
}
}

## `member_process_reset_password()`

| Parameter | Type | Description |
Expand Down