Skip to content

Commit 5dde852

Browse files
committed
update doc, fix duplicate hook, hook spelling
1 parent ad21202 commit 5dde852

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

docs/hooks.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,30 @@
22
SparkPost's WordPress plugin has a number of hooks that can be used to modify how it works and/or inject new functionality around its lifecycle.
33

44
### Convention
5-
Hook names are prefixed with `wpsp_`.There are some hooks that are common across mailers (http and smtp). Unless the hook applies to both mailer, it has either `smtp_` or `smtp_` after the initial prefix (`wpsp_`).
5+
Hook names are prefixed with `wpsp_`.
66

77
### List of hooks
88

9-
| Hook Name | Applicable Mailer | Description (Purpose) |
10-
| ------------- |:----------------:| -----:|
11-
| wpsp_get_settings | Both | Tap into settings objects
12-
| wpsp_init_http_mailer* | HTTP | Modify/replace http mailer instance
13-
| wpsp_http_get_lib | HTTP | Modify/replace http library
14-
| wpsp_http_before_send* | HTTP |
15-
| wpsp_http_after_send* | HTTP |
16-
| wpsp_http_handle_response | HTTP | Custom handler for http response. **Should return boolean to stop further processing.**
17-
| wpsp_http_recipients | HTTP |
18-
| wpsp_open_tracking | Both |
19-
| wpsp_click_tracking | Both |
20-
| wpsp_http_template_id | HTTP | Use a different template ID
21-
| wpsp_substitution_content_tag_name| HTTP | Use a different tag for content substitution
22-
| wpsp_http_body | HTTP |
23-
| wpsp_http_sender_email | Both |
24-
| wpsp_http_sender_name | Both |
25-
| wpsp_http_response_body | HTTP |
26-
| wpsp_http_recipients | HTTP |
27-
| wpsp_api_key | BOTH | Use different API Key/Password
28-
| wpsp_http_request_headers | HTTP |
29-
| wpsp_http_reply_to | HTTP |
30-
| spwp_http_body_headers | HTTP |
31-
| wpsp_smtp_msys_api | SMTP |
9+
| Hook Name | Description (Purpose)
10+
| ------------- |:----------------:|
11+
| wpsp_get_settings | Tap into settings objects
12+
| wpsp_init_mailer* | Modify/replace http mailer instance
13+
| wpsp_get_http_lib | Modify/replace http library
14+
| wpsp_before_send* |
15+
| wpsp_after_send* |
16+
| wpsp_handle_response | Custom handler for http response. **Should return boolean to stop further processing.**
17+
| wpsp_recipients |
18+
| wpsp_open_tracking |
19+
| wpsp_click_tracking |
20+
| wpsp_template_id | Use a different template ID
21+
| wpsp_substitution_content_tag_name| Use a different tag for content substitution
22+
| wpsp_sender_email |
23+
| wpsp_sender_name |
24+
| wpsp_response_body |
25+
| wpsp_api_key | Use different API Key/Password
26+
| wpsp_request_headers |
27+
| wpsp_reply_to |
28+
| wpsp_body_headers |
29+
| wpsp_smtp_msys_api
3230

33-
\* These are action hooks. So return value is irrelevant.
31+
\* These are action hooks. So return value is irrelevant.

mailer.http.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function get_request_body()
7777
$body = array();
7878

7979
// add recipients
80-
$body['recipients'] = apply_filters('wpsp_recipients', $this->get_recipients());
80+
$body['recipients'] = $this->get_recipients();
8181

8282
// enable engagement tracking
8383
$body['options'] = array(
@@ -410,6 +410,6 @@ protected function get_headers()
410410
$formatted_headers['CC'] = $this->stringify_recipients($cc);
411411
}
412412

413-
return apply_filters('spwp_body_headers', $formatted_headers);
413+
return apply_filters('wpsp_body_headers', $formatted_headers);
414414
}
415415
}

0 commit comments

Comments
 (0)