/**
 * Email template tag: username.
 * The donor's user name on the site, if they registered an account.
 *
 * @param int $payment_id
 *
 * @return string username.
 */
function give_email_tag_username($payment_id)
{
    $payment = new Give_Payment($payment_id);
    $user_info = $payment->user_info;
    if (empty($user_info)) {
        return '';
    }
    $email_name = give_get_email_names($user_info);
    return $email_name['username'];
}
/**
 * Email template tag: username
 * The donor's user name on the site, if they registered an account
 *
 * @param int $payment_id
 *
 * @return string username
 */
function give_email_tag_username($payment_id)
{
    $payment_data = give_get_payment_meta($payment_id);
    if (empty($payment_data['user_info'])) {
        return '';
    }
    $email_name = give_get_email_names($payment_data['user_info']);
    return $email_name['username'];
}