Form Help

TOPIC:

Attach 2 uploads 4 weeks 2 days ago #250170

  • Topic Author
  • paul1234ohio
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
So I would like to do this:

crosstec.org/en/support/online-documenta...udes-attachment.html

But I have two uploads in the same form. Is this possible?

Thanks,
Paul

Please Log in or Create an account to join the conversation.

Attach 2 uploads 4 weeks 1 day ago #250175

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 2267
  • Karma: 3
  • Thanks: 210
Hi,

yes, this is possible.
This part of code is for first upload where upload is name of your first upload file
foreach ($this->maildata as $data) {
 
  if( $data[_FF_DATA_NAME] == 'upload' )
{
   $body .= $data[_FF_DATA_TITLE].': http://www.yourdomain.com/path/to/uploads/' . basename($data[_FF_DATA_VALUE]);
} else {
   $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
 
  }
}
 

And if you want to add this for second upload just add this part of code for this where upload1 is name of your second file upload:
foreach ($this->maildata as $data) {
 
  if( $data[_FF_DATA_NAME] == 'upload1' )
{
   $body .= $data[_FF_DATA_TITLE].': http://www.yourdomain.com/path/to/uploads/' . basename($data[_FF_DATA_VALUE]);
} else {
   $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
 
  }
}
 

Let me know if you need more help

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Attach 2 uploads 4 weeks 1 day ago #250220

  • Topic Author
  • paul1234ohio
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Thanks.

Both uploads are in the same directory. How does it know do pick those two uploads to attach?

Please Log in or Create an account to join the conversation.

Attach 2 uploads 4 weeks 16 hours ago #250225

  • Topic Author
  • paul1234ohio
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Ok. It is sending the uploads correctly. Thank you so much, but now it is adding this to the bottom of the email:

Name of Applicant:: name Email:: name@name.com Repeat Email: name@name.comAddress:: adfasdf City:: Lewis Center State:: OH Zip Code:: 43035 Phone:: MYPHONENUMBER Location and statement of work to be done:: asdfasd Upload Drawing (Set1):: /home/mydir/public_html/media/breezingforms/uploads/2020_10_31_14_30_23_pjr851x315facebook.jpg Upload Drawing (Set2):: /home/mydir/public_html/media/breezingforms/uploads/2020_10_31_14_30_23_mainlogobig14.jpg Road Name:: adfad Township:: asdfa Date work is to begin:: 10/31/2020 Completion Date:: 11/04/2020 PLEASE SIGN YOUR FULL NAME HERE:: signatureU-18bbfde203f06bcff5e1cf7b69b09e62.png Name of Applicant:: Paul Risko Email:: name@name.com Repeat Email: name@name.com Address:: adfasdf City:: Lewis Center State:: OH Zip Code:: 43035 Phone:: MYPHONENUMBER Location and statement of work to be done:: asdfasd Upload Drawing (Set1):: /home/mydir/public_html/media/breezingforms/uploads/2020_10_31_14_30_23_pjr851x315facebook.jpg Upload Drawing (Set2):: /home/mydir/public_html/media/breezingforms/uploads/2020_10_31_14_30_23_mainlogobig14.jpg Road Name:: adfad Township:: asdfa Date work is to begin:: 10/31/2020 Completion Date:: 11/04/2020 PLEASE SIGN YOUR FULL NAME HERE:: signatureU-18bbfde203f06bcff5e1cf7b69b09e62.png

Please Log in or Create an account to join the conversation.

Last edit: Post by paul1234ohio.

Attach 2 uploads 3 weeks 5 days ago #250237

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 2267
  • Karma: 3
  • Thanks: 210
Hi,

could you please post here your code?

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Attach 2 uploads 3 weeks 5 days ago #250269

  • Topic Author
  • paul1234ohio
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
$this->execPieceByName('ff_InitLib');
$subject = 'APPLICATION FOR UTILITY PERMIT'; // Change to your preferred Email subject
$recipient = 'me@myemail.com'; // Change to your admin Email address

//grab values from fields that you want to pass in Admin email
$name= ff_getSubmit('Name');
$email= ff_getSubmit('email');
$Address= ff_getSubmit('Address');
$City= ff_getSubmit('City');
$State= ff_getSubmit('State');
$Zip= ff_getSubmit('Zip');
$phone= ff_getSubmit('phone');
$location= ff_getSubmit('location');
$road= ff_getSubmit('road');
$township= ff_getSubmit('township');
$StartDate= ff_getSubmit('StartDate');
$FinishDate= ff_getSubmit('FinishDate');
$signature= ff_getSubmit('signatureU');
$DRAWING1= ff_getSubmit('drawing1');
$DRAWING2= ff_getSubmit('drawing2');

$attachment = null;
$isHtml = true;

$body = " ";

 if (count($this->maildata)){
          foreach ($this->maildata as $data){
          
                $testEx = explode("\n", trim($data[_FF_DATA_VALUE]));
                $cntTestEx = count($testEx);
                if($cntTestEx > 1){
                      for($ex = 0; $ex < $cntTestEx; $ex++){
                            if(!is_array($attachment) && $attachment != ''){
                                    $attachment = array_merge(array(trim($testEx[$ex])), array($attachment));
                            }                            
                            else if(is_array($attachment)){
                                    $attachment = array_merge(array(trim($testEx[$ex])), $attachment);
                            }                            
                            else{
                                    $attachment = trim($testEx[$ex]);
                            }
                      }
                }                
                else{
                      if(!is_array($attachment) && $attachment != ''){
                             $attachment = array_merge(array(trim($data[_FF_DATA_VALUE])), array($attachment));
                      }                      
                      else if(is_array($attachment)){
                             $attachment = array_merge(array(trim($data[_FF_DATA_VALUE])), $attachment);
                      }
                      else {
                             $attachment = trim($data[_FF_DATA_VALUE]);
                      }
                }
 
           }
     } 
 
foreach ($this->maildata as $data) {
 
  if( $data[_FF_DATA_NAME] == 'upload' )
{
   $body .= $data[_FF_DATA_TITLE].': http://myurlcom.com/public_html/media/breezingforms/uploads/' . basename($data[_FF_DATA_VALUE]);
} else {
   $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
 
  }
}

foreach ($this->maildata as $data) {
 
  if( $data[_FF_DATA_NAME] == 'upload1' )
{
   $body .= $data[_FF_DATA_TITLE].': http://myurl.com/public_html/media/breezingforms/uploads/' . basename($data[_FF_DATA_VALUE]);
} else {
   $body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
 
  }
}
 
$this->sendMail($from, $fromname, $recipient, $subject, $body, $attachment, $isHtml);  // This line actually emails

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.
  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer 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!