TOPIC:

Re:Custom email noHanstifications howto 12 years 11 months ago #2705

  • moriwenne
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Karma: 5
  • Thanks: 1
Hi jimyjimjames. Let's see. By default if you tell breez to send the form to an email what happens is that all the fields appear in your email vertically. I'm assuming you got this far and that this is working properly for you?
Ok, next you'll notice that there are two files in the directory /administrator/components/com_facileforms/mailtpl/
which are mailtpl.txt.php and mailtpl.html.php.
So the code from breezing looks for a file in that directory by the name of 'yourformname.html.php' if it doesn't find it looks for 'yourformname.txt.php' then 'mailtpl.html.php' then 'mailtpl.txt.php'.

So you can create a new file there if you wish or just open up 'mailtpl.html.php' and change it.

If you open that one you'll see the php code that is creating your email.
You can use html and php to make this file send whatever email you desire.

At the bottom of the file you have this bit

<?php foreach ($MAILDATA as $DATA): ?>
<?=$DATA[_FF_DATA_TITLE]?>: <?=$DATA[_FF_DATA_VALUE]?><br /><?=$NL ?>
<?php endforeach; ?>

That's the part that is fetching your data and that's what you're interested in, if you know about all of what I've written above you can just start here but hey you had to read it all to get here anyway so I'm guessing this warning is irrelevant :)

Anyway, that cycle is going thru $data and it is fetching all the titles and values. Now, I haven't meddled with this so I'm gonna try to point you in the right direction. I don't know if this is all going over your head or if you understand php but if you don't let me know.
So one way that I can think of that could allow you to do what you want is to compare the data_title to your form field name so something like this could be used

if (strcasecmp($data[_FF_DATA_TITLE], "My field name")==0)

If that is true then it will mean that at that moment in the cycle "$data[_FF_DATA_VALUE]" will have the value that corresponds to the "my field name". At that point you could just say save it in a variable and after the cycle, get all the variables and organise it all in a table.

Anyhoo, get back to me if this was all very strange for you to follow and I'll try again.

Good luck.
Mori

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

Re:Custom email noHanstifications howto 12 years 11 months ago #2706

  • jimyjimjames's Avatar
  • jimyjimjames
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
hi mori

i think i understand but what is the if statement you wrote without the emoticon lol?

Thank you so much for your help
James Ashworth
Mediart Solutions
www.mediart.com.au

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

Re:Custom email noHanstifications howto 12 years 11 months ago #2707

  • moriwenne
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Karma: 5
  • Thanks: 1
lol damn smilies
just in case you were not joking

if (strcasecmp($data[_FF_DATA_TITLE], "My field name" == 0)

cheers
Mori

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

Re:Custom email noHanstifications howto 12 years 11 months ago #2708

  • jimyjimjames's Avatar
  • jimyjimjames
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
so to clarifiy it would look something like

<?php foreach ($MAILDATA as $DATA): ?>
<?=$DATA[_FF_DATA_TITLE]?>: <?=$DATA[_FF_DATA_VALUE]?><br /><?=$NL ?>

if (strcasecmp($data[_FF_DATA_TITLE], "My field name" == 0)
$myfield_name = blah
if (strcasecmp($data[_FF_DATA_TITLE], "My field name" == 0)
$myfield_name2 = blah
if (strcasecmp($data[_FF_DATA_TITLE], "My field name" == 0)
$myfield_name3 = blah
if (strcasecmp($data[_FF_DATA_TITLE], "My field name" == 0)
$myfield_name4 = blah

<?php endforeach; ?>

and then formatting here

oh and id probably get rid of
<?=$DATA[_FF_DATA_TITLE]?>: <?=$DATA[_FF_DATA_VALUE]?><br />

so that they arent displayed before the formatting?
James Ashworth
Mediart Solutions
www.mediart.com.au

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

Re:Custom email noHanstifications howto 12 years 11 months ago #2709

  • jimyjimjames's Avatar
  • jimyjimjames
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 27
  • Thanks: 0
also i have tried some test send outs and the form is not using my custom email. below is the code in my timesheet.html.php file
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
?>

<?php if ($RECORD_ID != ''): ?>
<?=$PROCESS_RECORDSAVEDID?> <?=$RECORD_ID ?><?=$NL ?>
<?php endif; ?>

<?=$PROCESS_FORMID?>* <?=$FORM ?><?=$NL ?>
<?=$PROCESS_FORMTITLE ?>* <?=$TITLE ?><?=$NL ?>
<?=$PROCESS_FORMNAME ?>* <?=$NAME ?><?=$NL ?>
<?=$PROCESS_SUBMITTEDAT ?>* <?=$SUBMITTED ?><?=$NL ?>
<?=$PROCESS_SUBMITTERIP ?>* <?=$IP ?><?=$NL ?>
<?=$PROCESS_PROVIDER ?>* <?=$PROVIDER ?><?=$NL ?>
<?=$PROCESS_BROWSER ?>* <?=$BROWSER ?><?=$NL ?>
<?=$PROCESS_OPSYS ?>* <?=$OPSYS ?><?=$NL ?>

<?php foreach ($MAILDATA as $DATA): ?>
<?=$DATA[_FF_DATA_TITLE]?>* <?=$DATA[_FF_DATA_VALUE]?><br /><?=$NL ?>

<?php endforeach; ?>

TEST

the timesheet.html.php file is the only file in the directory administrator/components/com_facileforms/mailtpl
James Ashworth
Mediart Solutions
www.mediart.com.au

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

Re:Custom email noHanstifications howto 12 years 11 months ago #2710

  • moriwenne
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Karma: 5
  • Thanks: 1
Yes that's how it would look and yes you would get rid of that line so it wouldn't show all the data.

blah there seems like it should be $data[_FF_DATA_VALUE], if the types match it should be ok if not some string conversion might be necessary.

Try renaming your timesheet... to mailtpl.html.php to see if it is used.

Mori

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

Moderators: ForumSupport
Time to create page: 0.054 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!