I’m trying to submit a newsletter subscription request using the querystring “http://firstname.lastname@example.org” making a GET request in PHP using the Requests library provided by WordPress, just like that code snippet:
$current_site = get_site_url();
$my_email = "email@example.com";
$subscription_url = $current_site . "/?na=s";
$newsletter_subscription_url = $subscription_url . "&ne=" . $my_email;
$response = Requests::get($newsletter_subscription_url);
When I use the link in my browser, the subscription works well with success, but using a GET request from PHP or a curl command in a shell like “curl http://firstname.lastname@example.org” I can’t subscribe.
Where is my error?
Is it possible to subscribe in that way or the plugin doesn’t permit to do that?
Is there another way to do the same thing, using the plugin provided functions, and, if yes, can I have an example and a code snippet to do the subscription operation?
Than you in advanced.