Home › Forums › Newsletter Plugin Support › Field rewrite for subscribed users
- This topic has 3 replies, 2 voices, and was last updated 8 years, 6 months ago by
Stefano.
-
AuthorPosts
-
February 24, 2015 at 8:59 am #15228
teachjapan
ParticipantStefano,
First thank you for your continued support (and sorry for being the annoying new user).
I’m going to use your plugin to gather users e-mails that are interested in my school’s quizzes. So the idea will be to make Quiz 1, Quiz 2, etc., on into the future.
As part of Quiz 1, the user can submit their answer (“Profile 1”). Through the confirmation I have no problems.
BUT, when I make Quiz 2 and I want the user to submit a second answer (“Profile 1” field, or even “Profile 2” that was previously unassigned), I’d like to overwrite the existing “Profile 1” field.
I’ve tested this, but this does not work with subscribed users. It only works with new users. Could you please advise a way around this?
Thank you in advance.
February 24, 2015 at 11:22 pm #15235Stefano
KeymasterIf you’re writing directly to the Newsletter database you shold be able to update a subscriber. Actually I don’t know the code you used so it’s hard to give a correct answer.
Stefano.
February 25, 2015 at 2:30 am #15242teachjapan
ParticipantStefano,
Thank you again!
Instead of rewriting the “Profile 1” field (for testing) I just tried to rewrite the “Name” field.
The original Name value of “Lee” was not rewritten with the new value when I subscribed with a previously confirmed e-mail address.
Here is the code:
<script type="text/javascript"> //<![CDATA[ if (typeof newsletter_check !== "function") { window.newsletter_check = function (f) { var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/; if (!re.test(f.elements["ne"].value)) { alert("The email is not correct"); return false; } if (f.elements["nn"] && (f.elements["nn"].value == "" || f.elements["nn"].value == f.elements["nn"].defaultValue)) { alert("The name is not correct"); return false; } if (f.elements["ny"] && !f.elements["ny"].checked) { alert("You must accept the privacy statement"); return false; } return true; } } //]]> </script> <div class="newsletter newsletter-subscription"> <form method="post" action="http://www.jabble.jp/openblog/wp-content/plugins/newsletter/do/subscribe.php" onsubmit="return newsletter_check(this)"> <table cellspacing="0" cellpadding="3" border="0"> <!-- first name --> <tr> <th>Name</th> <td><input class="newsletter-firstname" type="text" name="nn" size="30"required></td> </tr> <!-- email --> <tr> <th>Email</th> <td align="left"><input class="newsletter-email" type="email" name="ne" size="30" required></td> </tr> <tr> <th>More Quizzes</th> <td> <select class="newsletter-profile newsletter-profile-1" name="np1"> <option>Yes</option> <option>No</option> </select> </td> </tr> <tr> <th>Answer 2</th> <td> <input class="newsletter-profile newsletter-profile-3" type="text" size="30" name="np3"/> </td> </tr> <tr> <td colspan="2" class="newsletter-td-submit"> <input class="newsletter-submit" type="submit" value="Subscribe"/> </td> </tr> </table> </form> </div>
March 5, 2015 at 11:54 pm #15327Stefano
KeymasterHi a subscriber, once confirmed, cannot be changed with another subscription, otherwise anyone can hack your database with fake names! A subscriber can change it’s profile following the profile url you should add on the welcome email and on every newsletter you send.
-
AuthorPosts
- You must be logged in to reply to this topic.