TOPIC:

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

  • mrclar
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
Hi all,
First off all thanks for the previous solutions, it works for me.
My file is build up like this

<TABLE><TR><TD><B><U>Adres</U></B></TD></TR>
<TR>
<TD>Adres:</TD>
<TD><?php echo $value["adres"]?></TD>
</TR>
<TR>
<TD>Postcode:</TD>
<TD><?php echo $value["postcode"]?></TD>
</TR>
<TR>
<TD>Plaats:</TD>
<TD><?php echo $value["plaats"]?></TD>
</TR>
<TR>
<TD>Telefoon Prive:</TD>
<TD><?php echo $value["telefoonprive"]?></TD>
</TR>
<TR>
<TD>Telefoon Werk:</TD>
<TD><?php echo $value["telefoonwerk"]?></TD>
</TR>
<TR>
<TD>Telefoon Mobiel:</TD>
<TD><?php echo $value["mobiel"]?></TD>
</TR>
</TABLE>

<TABLE><TR><TD><B><U>Huisdieren</U></B></TD></TR>
<TR>
<TD>Heeft u huisdieren?:</TD>
<TD><?php echo $value["huisdier"]?></TD>
</TR>
<TR>
<TD>Welk huisdier?:</TD>
<TD><?php echo $value["welkhuisdier"]?></TD>
</TR>
</TABLE>


I want certain tables to be displayed standard (which is ok now, cause everything is displayed in the email template regardless of if its filled with info or not) and certain tables to not be displayed for example if the information has not been filled in by a user on the website.

Does anyone know the if statement which makes this possible?

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

Re:Custom email notifications howto 11 years 8 months ago #12829

  • Gregy1403
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Karma: -1
  • Thanks: 2
moriwenne wrote:

Ok jimyjim, let's think about this. The foreach effectively creates a cycle to run thru the array. That array is what you are given to work with and it contains pairs of datafield, value.
Now it makes sense that as you cycle thru the array, that if you want to reference the values later on then you have to assign the values to variables. That's what you were trying to do and it will be easier to read and use. You did speak about having 35 difference and damn! that's a big form :)
I hope you understand the process I explain above, it's how cycles work.

That said, you should also realise that, your data is already in a big multidimentional array, you just need to access it. How to do that? That's the question. Although the following will work, it might be hard to control and read but you will be the decider of how you want to proceed.
So say you have a table and at this position you want to insert the value from the 1st form field, then you could just put the line

<?=$MAILDATA[0][4] ?>

What that will do is get you the first field item (0) and then from that one, get the value (4). If I'm not mistaken, each item should have an id(0), title(1), name(2), somethingelse(3), value(4), that's why we choose 4. So for you to reference the 35th item you would use [34][4].
Of course this way you can't move things around after you finalise the email, otherwise if you do you'll have to update this file. But hey, forms don't usually change so as long as you put a comment on the mail.html.php file saying exactly what you're doing so that you can remember later and others can understand it, it's one way to go.

Anyway, just another couple of ideas I'm throwing your way, see what fits.

Enjoy
Mori

PS: I charge by word if I didn't mention it before. It's 0$ per word and I've written lots of words already so 0 times a lot of words makes hmm 0. Should consider charging a bit more in the future maybe.


Hi
Reading this post, trying various codes without luck. If i understood correct if i enter <?=$MAILDATA[1][4] ?> it will display Name, since this is the first field? It doesn't :(
Example my code
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>

<table border="0" width="100%" cellspacing="3" cellpadding="3">
	<tr>
		<td bgcolor="#C0C0C0"><font face="Verdana" size="2">Zdravo <?=$MAILDATA[1][4] ?>,<br>
		<br>

Am i missing something?

Thank you!

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

Re:Custom email notifications howto 11 years 8 months ago #12835

  • Gregy1403
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Karma: -1
  • Thanks: 2
went to basic reading again and got it with that numbers for calling fields :)

now, when i moved on, im creating (duplicating)a form. in mailtpl dir there are two files. I read that if i create another form i have top rename the file to the name of script. Would that be

newformbacktpl.html.php and newformtpl.html.php ?

Should i also rename default one to form name, now that i have two forms templates?

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

Re:Custom email notifications howto 11 years 8 months ago #12877

  • Gregy1403
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Karma: -1
  • Thanks: 2
can anybody please answer me?

Thank you

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

Re:Custom email notifications howto 11 years 8 months ago #12904

  • spencelk's Avatar
  • spencelk
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 76
  • Thanks: 9
no keep your defaults and then just create a new template for each also yes you are missing something
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
$field = array();
foreach ($MAILDATA as $DATA) {
$title[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_TITLE];
$value[$DATA[_FF_DATA_NAME]] = $DATA[_FF_DATA_VALUE];
}
?>

place that at the top of your code then you can make the references to your variables like this
<?php echo $value["welkhuisdier"]?>
verse the tedious way
<?=$MAILDATA[0][4] ?> 

hope this helps

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

Re:Custom email notifications howto 11 years 8 months ago #12913

  • Gregy1403
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 22
  • Karma: -1
  • Thanks: 2
i got that working very well. My problem is how to rename various templates for various forms, specially those for mailback.. they are all in one directory, so they have to have different names. That's my problem :)

Thank you

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

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