BulkGate / woosms

👻 Extend your WooCommerce store capabilities. Send personalized bulk SMS messages. Notify your customers about order status via customer SMS notifications. Receive order updates via Admin SMS notifications.
https://www.bulkgate.com/en/integrations/sms-plugin-for-woocommerce/
GNU General Public License v3.0
4 stars 2 forks source link

Filter content received through _bg_client.parseQuery #7

Open jarrodjay opened 2 years ago

jarrodjay commented 2 years ago

Hello,

Thanks, Jarrod.

lukaspijak commented 2 years ago

Hello,

Why do you want do it? Can you describe me your use case?

jarrodjay commented 2 years ago

The primary issue I have is the lack of customer-level filters for Woocommerce when creating a campaign within wooSMS. The included filters are very limiting, and don't have support for custom meta values (eg- create a campaign for customers who have ticked a "receive_promotions" checkbox when signing up), or even to filter by recent purchases (eg- create a campaign for customers who have submitted and order in the past 90 days).

The secondary issue I have is wanting to filter the sender profiles that are available when sending an SMS from the "view order" page in Woocommerce. I'm using the same bulkgate account for a couple of sites, and want to avoid particular sender IDs being used on one site.

jarrodjay commented 2 years ago

I'd also like to set a default sender ID when sending an SMS from within a Woocommerce Order. Trying to do so via jQuery is proving problematic, thanks to BulkGate's listeners and my inability to figure out what it wants exactly when submitting the SMS.

In theory, the below snippet should be fine. However, the event listener on div#react-app-root within "transactions~affiliate_~78900026-683c7cd....chunk.js:formatted", is messing with me.

jQuery(document).ready(function(){
  jQuery("#side-sortables #send_sms #woo-sms").bind("DOMSubtreeModified",function(){
    if(nowait == 0){
      nowait = 1;
        setTimeout(function () {
            console.log("Fully loaded, so changing phone number");
                jQuery("#side-sortables #send_sms #woo-sms select option[value=\"gSystem\"]").remove();
                jQuery("#side-sortables #send_sms #woo-sms select option[value=\"gShort\"]").remove();
                jQuery("#side-sortables #send_sms #woo-sms select option[value=\"gOwn\"]").prop("selected",true).parent().change();
                setTimeout(function () {
                        jQuery("#side-sortables #send_sms #woo-sms select option[value=\"61XXXXXXXXX\"]").prop("selected", true).change();
                }, 500);
        }, 500);
        }
  });
});
MartinKreizl commented 2 years ago

We have discovered the potential in both reported issues and will include them in our development plan in the next iteration