TOPIC:

Enter a variable as MailBackFile value ? 1 week 2 days ago #258306

  • Topic Author
  • MaitreCake
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 2
  • Thanks: 0
Hello,

I don't like to post a request before helping someone on a forum, but I am a kind of a newbie on Breezing form and not a big specialist regarding coding.

Here is my issue.
I would like to display a form on different articles in order to send by mailback an existing attached file wich will be different according to the page the form will be display.

With my poor acknowledgment, I have been able to create an element that take as a value the full path of the document.

The name of the field is produitPDF
<?php  $adr=$_SERVER['PHP_SELF']; 
$produitCode=basename($adr);
$produit=urldecode($produitCode);
$adrFiles="/var/www/html/Victor/doc/";
$fichierPdf=$produit.".pdf";
$source=$adrFiles.$fichierPdf;
return $source; ?>

The output is correct and if I paste the result in the MailBackFile field, the attached file is sent.

What I would like to do is to pass this produitPDF value to the MailBackFile field in a dynamic way.

The mail is sent without attached files :
- when I put directly the php code in the MailBackFile field (neither with echo or return).
- With ff_getElementByName('produitPDF').value

I saw some posts ( https://crosstec.org/en/forums/15-usage/125018-conditional-mailbackfile.htmlhttps://crosstec.org/en/forums/15-usage/125018-conditional-mailbackfile.html ) about submitting pieces or editing the facileforms.process.php.

I am a bit lost with these posts especially because it seems that all I want to do is to override the $attachment value or set the value of bfElementAdvancedMailbackfile with a variable but I don't know where to look.

As I said, I am new to Breezing Form, I chose it for its ability to send attached files.I would like to experience it more before having to set full emails as submitting pieces.

I am of course available to give you more details, and I can only express my gratefulness to anyone who would like to help me.:dry:

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

Enter a variable as MailBackFile value ? 1 week 2 days ago #258307

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

if I understood you correctly, then this will help to you:
crosstec.org/en/forums/15-usage/125018-c...backfile.html#230235

This is code for custom php mail, and it ​will send your existed attachment based on some value in your form's element.

Regards,
Tihana
The following user(s) said Thank You: MaitreCake

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

Enter a variable as MailBackFile value ? 1 week 2 days ago #258310

  • Topic Author
  • MaitreCake
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 2
  • Thanks: 0
Thank you for your quick reply.:)

As you may have seen, in my first post, I had already read this topic.
But because you dit resend me to it. I had a second look.

Instead of redefining the path to my file with the php code I put in the productPHP field, I did a
ff_getSubmit('produitPDF')
, and ... it works.:woohoo:

For any future reader, below is the code I put in Advanced options of my form > More options > Submit pieces / End Submit. It is a mix between the different ones found on the link mentioned previously
Please refer to my precious message about "produitPDF" especially the $adrFile part that is the path to yours documents.
$this->execPieceByName('ff_InitLib');
$from = 'sender@ILoveJoomla.com'; //change to wanted email
$fromname = 'Sender'; //change to wanted from name
$subject = 'Your Email Subject'; // Change to your preferred Email subject
$attachment = ff_getSubmit('produitPDF');
$recipient = ff_getSubmit('Email');
$isHtml = true;
$name=ff_getSubmit('Nom');
$mind='cri de la victoire';

$body =  "
<html><body>

<h1>Find enclosed your doc : </h1>

<table style='color:blue;'>
<tr>
<td>
   <strong>Bonjour : </strong>
</td>
<td>
   $name
</td>
</tr>

<tr>
<td>
   <strong> State of mind :</strong>
</td>
<td>
   $mind
</td>
</tr>
</table>
</body></html>";

$this->sendMail($from, $fromname, $recipient, $subject, $body, $attachment, $isHtml);

Thanks again Tihana.B)

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

Enter a variable as MailBackFile value ? 1 week 1 hour ago #258338

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

super! I am glad you found a working solution :)

If you need anything else, feel free to ask

Regards,
Tihana
The following user(s) said Thank You: MaitreCake

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.047 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!