Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author xnau webdesign

    (@xnau)

    If you want two forms, one that sends an email and one that doesn’t…not sure how you’d do that, the plugin doesn’t have this ability normally. Probably there is a way to add a filter to your theme functions file that would prevent the email if the submission came in from the form you don’t want sending an email. Do you know PHP at all?

    Thread Starter francescag

    (@francescag)

    Hi Xnau and thanks for the reply.

    What I need is exactly what you explained (If you want two forms, one that sends an email and one that doesn’t).

    I don’t know php like a pro, I’m able to understand common things editing something, but I have no idea of how I could do that ??

    Hope you can help. It would be fine also if the mail is different, I just need to get a different response (no mail or different content)

    Thank you!!

    Plugin Author xnau webdesign

    (@xnau)

    OK, well it is a little complicated because you have to use a filter which is added to your theme functions file. That requires that you be using a child theme, so there is that to set up as well if you aren’t already using one.

    Anyway, I wrote up a quick tutorial to explain the technique…it will require some basic knowledge about PHP, but it should be easy to follow:

    https://xnau.com/using-a-filter-to-change-the-user-signup-email/

    Thread Starter francescag

    (@francescag)

    Hi! Many thanks for you kindness, help and patience! Unfortunately I didn’t succeded!

    Infos:
    – I’ve created a field (hidden, signup) named Form Page with default value = page->page_name (without ” or ‘ or anything else)
    https://postimg.org/image/5sdgytu2j/
    – I’ve added your function to my function.php file into the child theme folder https://postimg.org/image/ee15qjty9/

    If I look the source of the page when it is loaded I see:
    <input type="hidden" name="form_page" value="page->page_name">
    Should form page already has the value of my page (which is iscrizione-admin)?

    Also if I print the form page value, after submission, this value remains page->page_name.

    Did I mistaken something adding the function to the function.php file?

    I also have to say that I still detain participant database version 1.4.7 but I didn’t upgraded because it worked and didn’t remember which edits I did (stupid me).

    Hope you can help!
    many many thanks

    Plugin Author xnau webdesign

    (@xnau)

    Sorry…I messed up! It should be “post->post_name” for the value of the hidden field.

    Thread Starter francescag

    (@francescag)

    Hi Xnau!

    Sorry if I bother you… with the value “post->post_name” the form_name finally gets the correct value (in my case iscrizione-admin) but.. sadly it still doesn’t work.. the subscriber still gets the email.. ??

    Any idea?

    Plugin Author xnau webdesign

    (@xnau)

    Well, there is likely some problem with the code not getting executed, it will work, I’ve tested it, but you need to make sure you’ve put it in correctly.

    Thread Starter francescag

    (@francescag)

    I know it’s dumb, but, from the screen I gave you of my function.php file do you think I put it correctly?

    Thread Starter francescag

    (@francescag)

    Can my error depend on the plugin version or by some other possible conflicts? Or it’s something stand alone that shoul just work?

    It seems to me that I put your function correctly ??

    Plugin Author xnau webdesign

    (@xnau)

    Ah…well that is embarrassing! I messed up the testing, I thought it worked, but I got it wrong. I updated the article with the change needed to make it work…instead of blanking out the “recipient” you need to blank out the value in the new record…code here:

    function my_modified_outgoing_email($outgoing_email) {
      // grab the values in the new submission
      $new_submission = $outgoing_email->participant_values;
      if ($new_submission['form_page'] == 'signup-2') {
       // blank out the recipient so the email won't be sent
       $outgoing_email->participant_values['email'] = '';
      }
     }
    Thread Starter francescag

    (@francescag)

    It’s so embarassing to me too because I still doesn’t work, despite the last change!

    This is the way I put the code in function.php under my child theme folder:
    https://dl.dropboxusercontent.com/u/2055243/shortcode.JPG

    Did I done something wrong?
    Sorry ??

    Thank you very much

    Thread Starter francescag

    (@francescag)

    I found something!

    With Firefox it’s working.. But with Chrome.. it’s not working..

    I couldn’t thought a thing like this could give such a conflict! Any idea?

    :((

    Plugin Author xnau webdesign

    (@xnau)

    The browser wouldn’t affect this…but there seems to be situations where the “form_page” value is not filled in, and this would cause the email to go out. It may be better to test for the page you want the email to go out on, and prevent it on all others:

    function my_modified_outgoing_email($outgoing_email) {
      // grab the values in the new submission
      $new_submission = $outgoing_email->participant_values;
      if ($new_submission['form_page'] != 'signup') {
       // blank out the recipient so the email won't be sent
       $outgoing_email->participant_values['email'] = '';
      }
     }

    This runs the risk that the email would not go out sometimes, however.

    Thread Starter francescag

    (@francescag)

    You are right, browser is not the issue! I’m now using a different pc and it does not work neither with Firefox nor Chrome.

    Not even changing the code with

    if ($new_submission['form_page'] != 'iscrizione') {

    Why it works for you, and not for me?!!

    What you mean when you say

    but there seems to be situations where the “form_page” value is not filled in, and this would cause the email to go out.

    The value form_page is always filled in, also when it does not work. I can see it from the inspector:

    <input type="hidden" name="form_page" value="iscrizione-admin">

    Do you think there is a way to solve this situation o there is no way to solve?

    Thread Starter francescag

    (@francescag)

    Seems to depend by the plugin version. I tested the code on another WP, with last version of the plugin and it works in the same browser that does not work for my website.

    Problem is I’m not sure I can upload plugin, can you guess which difference from version 1.4.7 can influence the correct working of the function?

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Duplicate the form’ is closed to new replies.