Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/27/2016 04:43:44 PM (9 years ago)
Author:
djpaul
Message:

Introduce base classes for new Email implementation.

  • Class BP_Email represents an email; the bits you see in your email client like the subject, message, recipients. It also encapsulates custom email headers and tokens.
  • Class BP_Email_Recipient represents an email recipient. It holds an email address and recipient name. If the class is instantiated with a WordPress user ID, then it also has a WP_User reference.
  • Interface BP_Email_Delivery is what mail delivery services will use to implement support for emails sent by BuddyPress.
  • Class BP_PHPMailer implements BP_Email_Delivery for PHPMailer.

See #6592. Props timersys, mercime, boonebgorges, hnla, DJPaul.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/functions.php

    r10159 r10470  
    708708        $this->assertTrue( empty( $not_image ) );
    709709    }
     710
     711    public function test_emails_should_have_correct_link_color() {
     712        $appearance = bp_email_get_appearance_settings();
     713
     714        $content    = '<a href="http://example.com">example</a>';
     715        $link_color = 'style="color: ' . esc_attr( $appearance['highlight_color'] ) . ';';
     716        $result     = bp_email_add_link_color_to_template( $content, 'template', 'add-content' );
     717        $this->assertContains( $link_color, $result );
     718
     719        $content     = '<a href="http://example.com" style="display: block">example</a>';
     720        $link_color .= 'display: block';
     721        $result      = bp_email_add_link_color_to_template( $content, 'template', 'add-content' );
     722        $this->assertContains( $link_color, $result );
     723    }
    710724}
Note: See TracChangeset for help on using the changeset viewer.