WooCommerce Email Center comes with action & filter hooks that allow developers to extend its functionality. Below is a list of available actions and filters.
Action: rp_wcec_before_custom_email_content
Used to output content programmatically just before custom email content.
Parameters:
$rp_wcec_email_id | integer | ID of custom email that is being sent |
$rp_wcec_trigger_id | integer | IDs of trigger that invoked this email |
$sent_to_admin | bool | Whether email is being sent to admin |
$plain_text | bool | Whether email format is plain text |
Action: rp_wcec_after_custom_email_content
Used to output content programmatically immediately after custom email content.
Parameters:
$rp_wcec_email_id | integer | ID of custom email that is being sent |
$rp_wcec_trigger_id | integer | IDs of trigger that invoked this email |
$sent_to_admin | bool | Whether email is being sent to admin |
$plain_text | bool | Whether email format is plain text |
Filter: rp_{post_type}_is_enabled
Enable/disable email, trigger or block programmatically. Substitute {post_type} with one of the following: wcec_email, wcec_trigger, wcec_block.
Parameters:
$is_enabled | bool | whether email, trigger or block is enabled |
$object | object | email, trigger or block object |
Filter: rp_wcec_email_headers
Override email headers.
Parameters:
$headers | string | email headers |
object | email object |
Filter: rp_wcec_email_attachments
Override email attachments.
Parameters:
$attachments | array | array of attachments |
object | email object |
Filter: rp_wcec_email_subject
Override email subject.
Parameters:
$subject | string | email subject |
object | email object |
Filter: rp_wcec_email_heading
Override email heading.
Parameters:
$heading | string | email heading |
object | email object |
Filter: rp_wcec_email_template
Override email template file.
Parameters:
$template | string | email template partial path |
Filter: rp_wcec_email_content
Override processed email content.
Parameters:
$content | string | processed email content |
$content_type | string | either text/plain or text/html |
object | email object |
Filter: rp_wcec_custom_macros
Add custom macros. Must return array in the following format:
array('macro_key' => array('value' => 'macro_value'))
Parameters:
$macros | array | array of custom macros |
$args | array | arguments passed to email template |
Filter: rp_wcec_from_email
Override "From" email address programmatically.
Parameters:
$from_email | string | "from" email address |
object | email object | |
$trigger | object | trigger object |
Filter: rp_wcec_from_name
Override "From" name programmatically.
Parameters:
$from_name | string | "from" name |
object | email object | |
$trigger | object | trigger object |
Filter: rp_wcec_to_email
Override recipient email address.
Parameters:
$to_email | string | "to" email address |
object | email object | |
$trigger | object | trigger object |
Filter: rp_wcec_admin_email
Override shop manager (admin) email.
Parameters:
$admin_email | string | admin email address |
Filter: rp_wcec_trigger_actions
Add custom trigger actions. Refer to class
RP_WCEC_Trigger::get_trigger_action_list()
for trigger action list format.
Parameters:
$trigger_actions | array | array of trigger actions |
Filter: rp_wcec_capability
Capability required to access this plugin.
Parameters:
$capability | string | WordPress user capability |
Filter: rp_wcec_date_format
Override date format.
Parameters:
$date_format | string | Date format (PHP date) |
Filter: rp_wcec_time_format
Override time format.
Parameters:
$time_format | string | Time format (PHP date) |