Forum Replies Created
-
AuthorPosts
-
James LeDouxParticipant
Yes, directly into an html field in the newsletter body.
James LeDouxParticipantOkay, found it. You have to hover over the right upper corner of the newsletter body section (below the header) and click on the Ruler/Pencil icon (says “Edit” when you hover over it). Then the settings appear on the right.
This is hard to find, so the documentation needs to be changed to make this easier to figure out, I searched “excerpts” and found nothing useful.
January 15, 2019 at 11:36 pm in reply to: A way to send an email or file to the account and automatically add subscribers? #146643James LeDouxParticipantAs shown in their documentation on the Newsletter REST API, user lists are designated with “lists”, so, you’d add that to the array, like:
$data = array("email" => $email, "api_key" => "your_key", "name" => $name, "lists" => $lists, "status" => "C"); $data_string = json_encode($data);
Again, you’d have to establish what your own variable names refer to, in this case, $name, $lists, etc. So, in your script, you’d have to tie $name to the person’s name you’re dealing with at the time, $lists to the lists they belong to, etc.
At least, I believe this should work, I haven’t tried it with lists.
June 11, 2018 at 11:34 pm in reply to: "More" tag at end of excerpt is now repeating the title #101715James LeDouxParticipantI am using a pretty old custom theme at this point. I made it from the default theme a couple years ago. Do I need to recreate it? Or can I copy something over from the current default theme to make it work correctly? Or how can I change the filter to make it work? Thanks.
June 7, 2018 at 11:02 am in reply to: A way to send an email or file to the account and automatically add subscribers? #100754James LeDouxParticipantThis is SO awesome! Newsletter Plugin, you rock!
Okay, should’ve just done my homework first before asking those last questions. The examples given in the documentation are command line arguments. I did some research, and for anyone else trying to figure this out, here’s how to make it work in a PHP script. (Variables like $email have to be established first, of course):
// Data in JSON format $data = array("email" => $email, "api_key" => "your_key", "name" => $name, "status" => "C"); $data_string = json_encode($data); // Prepare new cURL resource $ch = curl_init('https://www.your_website.com/wp-json/newsletter/v1/subscribers/add'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Set HTTP Header for POST request curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); // Close cURL session handle curl_close($ch); # Print response to check success. echo "<pre>" . $result. "</pre>";
June 7, 2018 at 9:20 am in reply to: A way to send an email or file to the account and automatically add subscribers? #100715James LeDouxParticipantGreat, that looks like it should work, but could you help me understand how to use it exactly? What we have is another subscription program for our hard-copy magazine on a subdomain of the same website that this plugin is on. We want to give magazine subscribers the option of subscribing to the newsletter. So, if they opt in, how do we send the api call exactly?
In the php, would we simply put this line in the code for an opted-in person, in an IF statement, for example?
curl -X POST http://<your-site>/wp-json/newsletter/v1/subscribe -d ‘{“email”:”test@example.com”, “name”:”My name”, “gender”:”f”}’Also, what’s the difference between that and this method?
curl -X POST -H “Content-Type: application/json” http://<your-site>/wp-json/newsletter/v1/subscribers/add -d ‘{“email”:”test@example.com”, “api_key”:”…”}’It says the latter works directly with the database, but wouldn’t they both add a subscriber to the db? and could we use the api key with the first one too? Is it more secure that way? In the second example, I suppose you could add the name and other info the same way you do in the first, correct?
Thanks for your help!
January 26, 2017 at 10:14 am in reply to: Running "Status" shows PHP execution time limit too low,but no suggested setting #29197James LeDouxParticipantAlso, the error message says, “Your PHP execution time limit is 600 seconds and cannot be changed or is too lower (sic)…”
So, it sounds like Newsletter is trying to change the setting itself, is that right? Or is there a way to exempt this plugin from the limit?
James LeDouxParticipantOkay, never mind, this is actually a styling issue. Your CSS has the labels as white. Since most web pages are white, this really ought to be changed — the text doesn’t show.
-
AuthorPosts