Followup on outstanding charges

function getFirstWord(str) {
        if (str.indexOf(' ') === -1)
            return str;
        else
            return str.substr(0, str.indexOf(' '));
    };

email = jQuery('.wc-customer-search.select2-hidden-accessible.enhanced').text().trim().match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)[0];
firstname = getFirstWord(jQuery('.wc-customer-search.select2-hidden-accessible.enhanced').text().trim());
payment_link = jQuery('label[for="order_status"] a').attr('href').replace('/order-pay/', '-express/');
website = jQuery('.display_meta:first tr:nth-child(2) p').text();
message = firstname +",\n\nYour web hosting payment for "+ website +" is now due. I did recently switch payment providers. Apologizes if this is first your seeing this. Below is a direct payment link. \n\nPayment link: " + payment_link;
subject = "Website Payment Followup - " + website;
console.log(message);
console.log(email + " " +subject);

Resending outstanding invoices

Calculating WooCommerce pending orders

Go to /wp-admin/edit.php?post_status=wc-pending&post_type=shop_order and run the following.

total = 0;
jQuery('.order_total .amount').each(function () {
    price = jQuery(this).text();
    total = total + parseInt(price.replace('$', ''));

});
total;