I want to send welcome mail while installing Shopify App using Autoresponder plugin

I use Autoresponder plugin for sending welcome email while installing Shopify Application.

I use RESTAPI

  1. login
  2. subscriberAdd
  3. listSubscriberAdd

and adding subscriber into the particular list.

When I using these API from POSTMAN it will be working fine.

  1. Login API

Parameter :
login:
pasdsword:

  1. SubscriberAdd API

Parameter :
email:xyz@yopmail.com
confirmed:1
htmlemail:1
foreignkey:
subscribepage:
password:
disabled:

  1. listSubscriberAdd API

Parameter :
list_id:2
subscriber_id:18 (dynamic generated subscriber_id)

When I use postman it will send mail successfully and it set already sent = 1 (mail already sent)
Subscribers ready | not ready | already sent => 0 | 0 | 1.

But using the Shopify-Laravel code adding subscriber into the particular list but not send an email.
But using these code it only set Subscribers ready | not ready | already sent => 1 | 0 | 0.

I am trying to send welcome mail while installing Shopify App. this is my shopify-laravel code

                         /* PHPLIST START */
                        $subpost_params = 'cmd=login&login=admin&password=********&cmd=listSubscribers&list_id=2';
                        $GetSubscruberAPIs = $sh->callApi($subpost_params);
                        $email_array = array();
                        foreach ($GetSubscruberAPIs->data as $key => $data) {
                            $email_array[] = $data->email;
                        }
                        if (!in_array("vijay2244@yopmail.com", $email_array)) {
                        $post_params ='cmd=login&login=admin&password=****************&cmd=subscriberAdd&email=vijay2244@yopmail.com&confirmed=1&htmlemail=1';
                            $LoginAPIs = $sh->callApi($post_params);
                            if ($LoginAPIs->data->id != '') {
                                $post_params1 = 'cmd=login&login=admin&password=************&cmd=listSubscriberAdd&list_id=2&subscriber_id=' . $LoginAPIs->data->id;
                                $LoginAPIs1 = $sh->callApi($post_params1);
                            }
                        }
                        /* PHPLIST END */

This is my function for CURL

public function callApi($post_params, $decode = true) {
        
        // Serialise and encode query
        $service_url = 'http://xyz.com/lists/admin/?page=call&pi=restapi';
        // Prepare cURL
        $c = curl_init();
        curl_setopt($c, CURLOPT_URL, $service_url);
        curl_setopt($c, CURLOPT_HEADER, 0);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_POSTFIELDS, $post_params);
        $result = curl_exec($c);

        if (curl_errno($c)) {
            print "Error: " . curl_error($c) . PHP_EOL;
        }
        // Check if decoding of result is required
        if ($decode === true) {
            $result = json_decode($result);
        }
        //echo "<pre>";print_r($result);die;
        return $result;
    }

Using these code adding subscriber into the particular list. but Autoresponder status
Subscribers ready | not ready | already sent => 1 | 0 | 0.

it never set already sent = 1 (mail already sent)

When I use postman it will send mail successfully and it set already sent = 1 (mail already sent)
Subscribers ready | not ready | already sent => 0 | 0 | 1.
But using these code it only set Subscribers ready | not ready | already sent => 1 | 0 | 0.

And Manually send campaigns from PHPList software it will be working fine.
Subscribers ready | not ready | already sent => 0 | 0 | 1.

@vijay.zestard Sorry but you are still not being clear on what exactly is not working.

When you use the Autoresponder plugin you need to run processqueue periodically in order to send to subscribers who are now “ready”. You should run processqueue periodically using a cron job. Please see the documenation at https://resources.phplist.com/plugin/autoresponder

This is my command line cronjob.Run every 30 mints

I know how to use Autoresponder. I read its documentation. Did you get my question?

@vijay.zestard Right, so you need to wait until the next run of the cron job for the autoresponder to send the campaign. That can be up to 30 minutes after adding the subscriber from Laravel.

I’m not sure that you understand how the Autoresponder plugin works. That is explained in the documentation.

it takes to many times for executing. if i run manually from PHPList software it will display these type of error.

This is the latest image. please tell me how can i solve it.

@vijay.zestard That seems to indicate there is something wrong with the subscriber who it is trying to send to.

You should look at the subscriber’s details in phplist, and also use phpmyadmin to see the time that they were added to the list.

is there any change in config.php or config_extended.php file so I solve this problem?

@vijay.zestard It is nothing to do with the config file but with the subscriber that you are trying to send to.

I don’t really follow what you have been doing, so I suggest that you start again with a new campaign and a new autoresponder for that campaign. You should disable the current autoresponder.
Then you can try adding a new subscriber from Laravel.