How do I change the form so that the Email's FROM field shows the name and Email address of the person who submitted the form?

 

*NOTE: Setting the from Email address can be rejected by some mailing services!

 

IF YOUR NAME FIELD IS CONTAINED WITHIN ONE FIELD

  1. In your form's properties, make sure that the "Mail Notification" checkbox is UNCHECKED.
  2. Copy the code below.
    global $mosConfig_mailfrom, $mosConfig_fromname, $my;
    $this->execPieceByName('ff_InitLib');
    $from = ff_getSubmit('email');
    $fromname = ff_getSubmit('name');
    $recipient = 'your@email.com'; /* Change to Your Admin Email Address */
    
    // Create the Body format for use in e-mail
    foreach ($this->maildata as $data)
    {
         if ($data[_FF_DATA_TYPE] != 'Hidden Input')
         {
              $body .= $data[_FF_DATA_TITLE].":
              ".$data[_FF_DATA_VALUE].nl();
         }
    }
  3. Make Changes to the Code as Needed - IMPORTANT! The above code assumes that the "Name" element on the form is actually called "name" (minus the quotes) in the NAME field underneath the label, and that the "Email" element on the form is actually called "email" (minus the quotes) in the NAME field underneath that element's label. Also, remember to change 'youradminemail@yourdomain.com' in the last line of code to your actual admin email address.
  4. Once you have edited and copied the code, go to Form Properties > Advanced Tab, and click on the "More Options" link.
  5. Go to the SUBMIT PIECES tab, to the END SUBMIT section, and click on the CUSTOM radio button. That will open a text area into which you should paste the code that you just edited and copied.
  6. Click on the SAVE icon at the bottom of that screen to save the code you just added. 92Users Guide Crosstec/Breezing Forms
  7. Once back at the base page of your form, click on the SAVE icon in the upper right-hand corner of the screen to save the form itself.
  8. Test your form to see if it works.

 

 

IF YOUR NAME FIELD IS SPLIT INTO FIRST NAME AND LAST NAME

If you have your name field separated into two fields - first and last name - then the code will need to be adjusted slightly. In that case, use the following:

  1. In your form's properties, make sure that the "Mail Notification" checkbox is UNCHECKED.
  2. Copy the code below. 
    global $mosConfig_mailfrom, $mosConfig_fromname, $my;
    $this->execPieceByName('ff_InitLib');
    $from = ff_getSubmit('email');
    $fromname = ff_getSubmit('fname').' '.ff_getSubmit('lname');
    $recipient = 'your@email.com'; /* Change to Your Admin Email Address */
    
    // Create the Body format for use in e-mail
    foreach ($this->maildata as $data)
    {
         if ($data[_FF_DATA_TYPE] != 'Hidden Input')
         {
              $body .= $data[_FF_DATA_TITLE].":
              ".$data[_FF_DATA_VALUE].nl();
         }
    }
    
    $this->sendMail($from, $fromname, $recipient, $body);
    // This line actually emails the form.
  3. Make Changes to the Code as Needed - IMPORTANT! The above code assumes that the "First Name" element on the form is actually called "fname" (minus the quotes) in the NAME field underneath the label, and that the "Last Name" element on the form is actually called "lname" (minus the quotes) in the NAME field underneath the label. Also, remember to change 'youradminemail@yourdomain.com' in the last line of code to your actual admin email address.
  4. Once you have edited and copied the code, go to Form Properties > Advanced Tab, and click on the "More Options" link.
  5. Go to the SUBMIT PIECES tab, to the END SUBMIT section, and click on the CUSTOM radio button. That will open a text area into which you should paste the code that you just edited and copied.
  6. Click on the SAVE icon at the bottom of that screen to save the code you just added.
  7. Once back at the base page of your form, click on the SAVE icon in the upper right-hand corner of the screen to save the form itself.
  8. Test your form to see if it works.

 

 

I like this, but I want to send my form to multiple Admin emails. Can I do that?

 

Yes, you can. Just replace the last line of code with:

$this->sendMail($from, $fromname, "yourAdmin1@email.com",$subject, $body); // This line actually emails the form to admin1.
$this->sendMail($from, $fromname, "yourAdmin2@email.com",$subject, $body); // This line actually emails the form to admin2.
$this->sendMail($from, $fromname, "yourAdmin3@email.com", $subject, $body); // This line actually emails the form to admin3.

(Can be added as many times as needed -- one for each Email address you need to send out.)

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!