shopp_customer_marketing_list()

get a list of customer names, type, and email addresses for marketing

shopp_customer_marketing_list ( $exclude )

@param bool $exclude true to exclude customers that do not allow marketing, false to include all customers
@return array of StdClass objects with firstname, lastname, type, email, and marketing setting of all customers for email marketing

Description

get a list of customer names, type, and email addresses for marketing

Example

// get only list of customers that allow marketing emails
$allowed_to_market = shopp_customer_marketing_list( true );

foreach ( $allowed_to_market as $customer ) {
    $to = "{$customer->firstname} {$customer->lastname} <{$customer->email}>";
    $subject = 'My Marketing Message';
    $message = "Dear {$customer->firstname},\nBuy my products, or I'll keep sending you emails!";

    // get my merchant email address for the From address
    $headers = array('From' => shopp_setting('merchant_email'));

    // send my marketing email
    wp_mail( $to, $subject, $message, $headers );
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar