This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Sending to: 2 Emails rather than 1


  1. testalex
    Member

    Hi,

    I would like to use the "Send to" feature to send to 2 emails entered on the form.
    At the moment we can only choose 1 email from the dropdown but i would like to send a copy to another person.

    Is there a way around this? or maybe a feature which im not aware of.

    Thanks for reading, hope you guys can help!

    Posted 15 years ago #
  2. redityo

    Hi,

    This modification is possible by editing "includes/post-functions.php" file. I assume your form id is 14 with 2 email fields element id 1 and 2. Then go to line 1127 ~ 1129, you'll see these code :

    if(is_numeric($esr_email_address)){
    	$esr_email_address = '{element_'.$esr_email_address.'}';
    }

    put these code exactly bellow that line

    if ($form_id == 14) {
    	$esr_email_address = '{element_1},{element_2}';
    }

    and if you've a review page activated, you need to put those code around line 2242, exactly bellow these code :

    if(is_numeric($esr_email_address)){
    	$esr_email_address = '{element_'.$esr_email_address.'}';
    }

    Don't forget to change the ID's with yours


    MachForm Support

    Posted 15 years ago #
  3. rockit55
    Member

    Hi,
    I included this code in my form as well and it works great!

    I did find however that my line #'s were different than yours, but no big deal.

    In addition, it is important to note that by including this code in the "post-functions.php" file, that the notifications are now sent automatically by default. In otherwords, you don't have to do ANYTHING with the form itself. I mistakenly thought that I had to go back to the "Send To" section and change *something*...but it wasn't necessary. Now, when the form is submitted, it goes to 3 persons. (1 identified in Your Email Address, the 2nd email address specified in (my){element_8} and the 3rd to the email specified in (my){element_10}).

    Thanks again for helping us through this!
    I Love MachForm!
    RockIT

    Posted 15 years ago #
  4. azsupergirl
    Member

    I have 13 forms created but I only want one of the forms to go to multiple emails when submitted. Will this change shown above affect all my other forms?

    Posted 14 years ago #
  5. redityo

    No, it will filtered by the form id. You can see this line in above code :

    if ($form_id == 14)

    that would make the customization will work only on form 14. You only need to change the id's with one of your forms.


    MachForm Support

    Posted 14 years ago #
  6. azsupergirl
    Member

    I put the code in exactly how it is above below that line and I changed the ID to my form ID but nothing happened. I don't see where I can designate what 2 addresses for the email to go to. Am I doing something wrong?

    Posted 14 years ago #
  7. yuniar

    azsupergirl -- if you simply need to set your form to send the result to a fixed email addresses, then you don't need the above modification.

    Simply enter multiple email address from the admin panel as normal, separate them with commas.


    MachForm Founder

    Posted 14 years ago #
  8. azsupergirl
    Member

    Thanks Yuniar!

    Posted 14 years ago #

RSS feed for this topic

Reply