wpmem_email_filter

Description

Filters the email and some of the email settings.

Parameters

$email
(array) (required) An array of information for the email process:

  • subj – the email subject
  • body – the email body/content
  • tag- what email is being sent (newreg|newmod|appmod|repass|getuser)
  • toggle – deprecated in 3.2 – use tag instead
  • user_id – the user’s ID
  • user_login – the user’s username
  • user_email – the user’s email address
  • blogname – the name of the blog (get_option ( ‘blogname’ ))
  • exp_type – the user’s subscription type (PayPal Extension Only)
  • exp_date – the user’s expiration date (PayPal Extension Only)
  • wpmem_msurl – the URL of the User Profile shortcode page, if set
  • reg_link – the URL of the page the user registered on
  • do_shortcodes – true|false boolean to enable the WP-Members email shortcodes (default: true)
  • add_footer – true|false boolean to enable adding the footer to the email (default: true)
  • footer – the default footer (3.1 and higher only)
  • disable – true|false boolean to disable sending the email (default: false)
  • headers – the email headers

$wpmem_fields
(array) (optional) The WP-Members fields array.

$field_data
(array)(optional) An array of the registration data.

Usage

This example runs a filter that will output the contents of the $arr, $wpmem_fields, and $fields_data arrays and send them to you in the new registration email. This is just an example to show you what data is available in the filter.

[snippet slug=wpmem_email_filter-advanced-example lang=php]

This example disables any specified emails (by tag):

[snippet slug=disable-wp-members-emails lang=php]

Changelog

Introduced in version 2.9.7

toggle replaced with tag in 3.2.0

Source

wpmem_email_filter is located inĀ includes/class-wp-members-email.php.