Support » Plugin: WP SMS » Automaticly add users to group

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hi,

    It’s possible, use the below code:

    <?php
    $subscriptions = new WP_SMS_Subscriptions();
    
    // Add subscriber
    $subscriptions->add_subscriber('name', 'mobile', 'group_id', 1);

    Hi Im looking for the same here.

    If i would add this 3 people to group_id=2 :

    Joe Doe, 2312543454, 2
    Jack David, 8472583673, 2
    Nicole Smith, 3857205823, 2

    How would you make the code ?

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hi @simondev,

    Use the below code:

    <?php
    $subscriptions = new WP_SMS_Subscriptions();
    
    // Add subscriber
    $subscriptions->add_subscriber('Joe Doe', '2312543454', '2', 1);
    $subscriptions->add_subscriber('Jack David', '8472583673', '2', 1);
    $subscriptions->add_subscriber('Nicole Smith', '3857205823', '2', 1);

    One more question.

    Is it posible to automaticly make a new group ?

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Dear @helgipetersen,

    You can create a group with below code:

    <?php
    $subscriptions = new WP_SMS_Subscriptions();
    
    // Add subscriber
    $subscriptions->add_group('Your group name');
    $groups = $subscriptions->get_groups();
    print_r($groups);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Automaticly add users to group’ is closed to new replies.