TOPIC:

Re:Custom email notifications howto 11 years 9 months ago #10942

  • deenfoxx
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 15
  • Karma: 1
  • Thanks: 1
I couldn't find an answer in the forum, so I thought I might give you my solution for populating a form by field names...

<!-- This was part of the initial mailtpl.txt.php -->
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
?>
<!-- I deleted all the other unwanted data, you could leave it in though. -->

<!-- This puts all the data into a hashed array... -->
<?php
$field = array();
foreach ($MAILDATA as $DATA) {
$title[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_TITLE];
$value[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_VALUE];

// I didn't need the following, but perhaps someone else will.
// So uncomment the following if you wish...
// $id[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_ID];
// $type[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_TYPE];

}
?>
<!-- The previous prints nothing, it just associates the names with their values. -->

<!-- This is the actual text which will be sent in the e-mail... -->
This is a quick test. For example, <?php echo $title["field_name_assigned"]?> = <?php echo $value["field_name_assigned"]?>.
<!-- Repeat wherever you want a specific field you named in BF. That's all folks. -->


Then you wouldn't have to try and figure out the array numbers.

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

Re:Custom email notifications howto 11 years 9 months ago #10943

  • grayceworks
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 24
  • Thanks: 0
Very cool. I can already see how I can use that. Thanks!

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

Re:Custom email notifications howto 11 years 9 months ago #11128

  • llebaigue
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Is there an easy way to create a custom email notification based on the QuickMode standard qmtheme?
I've managed to get my output in html and on separate lines (had to use the <br/>) but I'm lost beyond that.

I'd even be happy with just having all questions in the left side of a table and answers in the right side (50% each side.)

Any help is much appreciated.

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

Re:Custom email notifications howto 11 years 9 months ago #11328

  • mksmedia
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 20
  • Thanks: 0
Can someone shed some light for a newbie. I would like to use the code above but don't know what to replace with my specific info. i.e I would like to use my firstname field which is "t1firsName" but do not know where to put it in the code and have it changed to the value of this field.

Thanks in advance

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

Re:Custom email notifications howto 11 years 9 months ago #11329

  • llebaigue
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
I figured out how to make a custom form notification that is easy to read. It's not pretty but it works for the job application I made so that the questions and answers can be quickly browsed through. First you have to create the following file:
mailtpl.html.php in the following directory administrator/componenets/com_facileforms_mailtpl

This will allow the program to send HTML formatted emails.

In the file put the following code:

<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
?>

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

<?php foreach ($MAILDATA as $DATA): ?>

<table width="90%" border="1">
<tr>
<td width="60%"><?php echo $DATA[_FF_DATA_TITLE]?>:</td>
<td width="40%"><?php echo $DATA[_FF_DATA_VALUE]?></td>
</tr>
</table>

<?php endforeach; ?>


<?php echo $PROCESS_FORMID?>: <?php echo $FORM ?><br/>
<?php echo $PROCESS_FORMTITLE ?>: <?php echo $TITLE ?><br/>
<?php echo $PROCESS_FORMNAME ?>: <?php echo $NAME ?><br/>
<?php echo $PROCESS_SUBMITTEDAT ?>: <?php echo $SUBMITTED ?><br/>
<?php echo $PROCESS_SUBMITTERIP ?>: <?php echo $IP ?><br/>
<?php echo $PROCESS_SUBMITTERID ?>: <?php echo $SUBMITTERID ?><br/>
<?php echo $PROCESS_SUBMITTERUSERNAME ?>: <?php echo $SUBMITTERUSERNAME ?><br/>
<?php echo $PROCESS_SUBMITTERFULLNAME ?>: <?php echo $SUBMITTERFULLNAME ?><br/>
<?php echo $PROCESS_PROVIDER ?>: <?php echo $PROVIDER ?><br/>
<?php echo $PROCESS_BROWSER ?>: <?php echo $BROWSER ?><br/>
<?php echo $PROCESS_OPSYS ?>: <?php echo $OPSYS ?><br/>




What this does is put the record ID at the top and then the questions in the left side of a table at 60% and the answers in the right side at 40%. At the bottom of the email are the extra information like IP address.

Good luck!

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

Re:Custom email notifications howto 11 years 9 months ago #11331

  • mksmedia
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 20
  • Thanks: 0
Thanks for your reply. The code you have:<?php foreach ($MAILDATA as $DATA): ?>

<table width="90%" border="1">
<tr>
<td width="60%"><?php echo $DATA[_FF_DATA_TITLE]?>:</td>
<td width="40%"><?php echo $DATA[_FF_DATA_VALUE]?></td>
</tr>
</table>

<?php endforeach; ?>

displays all the fields from the form. I needed to pick and choose what fields from my form I wanted to display in the email. My form has credit card info that I want to exclude in the thank you email but I don't know if I am supposed to replace, <?php echo $DATA[_FF_DATA_TITLE]?> with my field i.e <?php echo $DATA[t1firstName]?> etc...

how do you code the email template to only pick up the fields you want to put in there?

Thanks

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

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