private function get_customer_emails_by_license_key()
{
if (!class_exists('EDD_Software_Licensing')) {
return array();
}
$subject_line = $this->data['ticket']['subject'];
$last_word = substr($subject_line, strrpos($subject_line, ' ') + 1);
// only search for license key if last word actually looks like a license key
// this check is dirty, as people could be using the filter in EDD for generating their own type of licenes key...
if (strlen($last_word) === 32) {
$license_key = $last_word;
$edd_sl = edd_software_licensing();
$license_id = $edd_sl->get_license_by_key($license_key);
$payment_id = get_post_meta($license_id, '_edd_sl_payment_id', true);
$user_info = edd_get_payment_meta_user_info($payment_id);
if (!empty($user_info['email'])) {
return array($user_info['email']);
}
}
return array();
}