• Roundup WP
  • Products
    • Registrations for the Events Calendar Pro
      • Buy Now
      • Setup (Pro)
      • Demo
    • Stripe Extension
      • Buy Now
      • Setup
    • Mailchimp Extension
      • Buy Now
      • Setup
    • Mollie (iDEAL) Extension
      • Buy Now
      • Setup
    • Discount Codes Extension
      • Buy Now
      • Setup
  • Support
    • FAQs and Troubleshooting
    • Codex
    • Contact Support
  • My Account
  • Get Pro

Filter: rtec_email_recipients

Posted on January 14, 2015

rtec_email_recipients is a filter for dynamically assigning email addresses to the list of recipients for email messages sent from the plugin.

Usage

<?php add_filter( 'rtec_email_recipients', 'function_name', 10, 3 ); ?>

Parameters

$recipients – (array) Array of email addresses added as the “to:” name.
$template_type – (string) Type of email template being used, “confirmation” or “notification”.
$data – Event and registration data attached to the email, if it exists.

Changelog

Pro
2.11 – introduced

Example: Send Confirmation Emails to More Than One Email Address

Step 1) Create a form field for recording an additional email address (or multiple fields for multiple additional email addresses)

Step 2) Use this code that searches every field for a valid email address and adds it as a recipient for all confirmation emails.

function ru_confirmation_to_additional_emails( $recipients, $template_type, $data ) {
    if ( $template_type === 'confirmation' ) {
        foreach ( $data as $key => $value ) {
            if ( $key !== 'email' && is_email( $value ) ) {
                $recipients[] = $value;
            }
        }
    }

    return $recipients;
}
add_filter( 'rtec_email_recipients', 'ru_confirmation_to_additional_emails', 10, 3 );
Registrations for the Events Calendar Pro logo
Learn about the plugin our users are raving about Unmatched customer support from WordPress experts. Learn More