Anhang und Inhalt formatieren

  • Albatros
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0

Albatros created the topic: Anhang und Inhalt formatieren

Hallo zusammen,

ich versuche gerade eine alte Anwendung in Breezing Forms abzubilden. Die Eingabefenster sind geschrieben und mit dem Submit Button wird eine Mail an die richige Adresse übertragen, angehängt ist eine .csv Datei mit den eingetragenen Inhalten.
Um diese mit meinem vorhandenen Workflow sinnvoll weiterverarbeiten zu können müsste ich den Namen der angehängten Datei manipulieren können (Abhängig von den Einträgen im Formular) und den Inhalte der gesendeten Datei auch frei definieren können. ( Also welcher Wert wird in welcher Reihenfolge in die Datei geschrieben.
Gibt es dafür irgendwo eine Anleitung (hab schon längere Zeit gestöbert und nichts gefunden) ? Kann mir jemand mit einer Newbie gerechten Anleitung helfen? Ich verwende den Quick Mode.

Vielen Dank
Holger
#237400
  • Posts: 2629
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Anhang und Inhalt formatieren

Hello,

I hope that we can continue in English since we don't have a German-speaking support staff member at the moment.

The CSV attachment which is sent along with email is generated in the following file:
Joomla/components/com_breezingforms/facileforms.process.php
starting from around line 5190 to 5306.

The name of the CSV export file is generated around line 5290 with this line of ccode:
$csvname = $this->uploads . '/ffexport-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.csv';

There you can change the CSV file name to whatever suits you.
For example, if you would want to change the name to static value it would look like this:
$csvname = $this->uploads . '/WANTEDNAME-' . mt_rand(0, mt_getrandmax()) . '.csv';
You would just have to replace WANTEDNAME with the name you wish to use.

If you wish to use a value that the user filling in the form has entered in a certain field in the form (let's say name of that field is FIELDNAME), you would have to replace this line of code:
$csvname = $this->uploads . '/ffexport-' . $date_stamp . '-' . mt_rand(0, mt_getrandmax()) . '.csv';
with this code:
foreach($xmldata as $data){
            if ($data[_FF_DATA_NAME] == "field2"){ $fieldValue = $data[_FF_DATA_VALUE]; }
			}
		$csvname = $this->uploads . '/' .$fieldValue . '.csv';
You could also use the user's username in the name of CSV attachemt file similar as explained here crosstec.org/en/forums/15-usage/123352-u...achments.html#222593 .

As for the second part of your request, chaning the order of the fields in the CSV attachment and deciding which files to include will be harder to achieve. That is not a native BreezingForms feature, but if you have some coding knowledge in PHP, you can try to do so in lines from 5190 to 5306 where the "expcsv" function is defined.

This topic crosstec.org/en/forums/1-forums/125628-csv-export.html#233199 is about CSV export in Manage Records and not the CVS attachemnt which comes along with email, but it might help you achieve what you want.

P.S. Sorry for the late response, we had a lot of requests.

Let me know whether this helped.

Regards,

Mihaela
#237523
Moderators: tomeperica
Time to create page: 0.077 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here