Custom email notifications howto

  • Posts: 23
  • Karma: 5
  • Thank you received: 1

moriwenne replied the topic: Re:Custom email noHanstifications howto

Alrighty Hans. So, you're using the RM_ContactForm.html.php as your html file.
Looking at your code it looks fine, meaning, the default html file with give you all the data horizontally but yours will not, you have the <br /> in it so it should be creating newlines.
What you're probably getting is the formtitle, browser, provider, etc in new lines but the data itself isn't?
Is that it?
I can see from your code that you have no new lines in the data part that would be


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

That will create all the data in your email, TITLE: VALUE, so you need a <br /> after the value like this
<?=$DATA[_FF_DATA_TITLE]?>: <?=$DATA[_FF_DATA_VALUE]?><br /><?=$NL ?> <?php endforeach; ?>

Now, what you should effectively do is take away all the <?=$NL ?> and transform them into <br />.
But since your building html here you could be making some nice tables and all with it, you already have some nice paragraphs and bolds :)

Anyway, that's surely it, the <br /> after the data, tell me if it fixes it.

Mori
#2205
  • Hans
  • Visitor
  • Visitor

Hans replied the topic: Re:Custom email noHanstifications howto

Mori,

It worked!

Replacing
<?=$NL ?>
with
<br />
did the job in putting it into new lines.

2 additional remarks

1. textarea in html version shows the text next to each other.
in the txt version when you enter several lines into the text area, the output is like you entered it, which is better of course.

Is there a way to change such behaviour in an html layout?

2. is there a trick to change mail subject to something else, for example the form name...

Thanks for your help so far, you have been more then helpful!

I hope someone else can benefit it, I'll show my nem code for informational purposes...

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

<p><b>Contact</b><br />
Verzonden op: <?=$SUBMITTED ?><br />
<br />
</p>
<p><?php foreach ($MAILDATA as $DATA): ?>
<b><?=$DATA[_FF_DATA_TITLE]?>:</b> <?=$DATA[_FF_DATA_VALUE]?><br />
<?php endforeach; ?>
</p>

<p>
<b>Extra informatie:</b>
<br />
<?=$PROCESS_FORMTITLE ?>: <?=$TITLE ?><br />
<?=$PROCESS_SUBMITTEDAT ?>: <?=$SUBMITTED ?><br />
<?=$PROCESS_SUBMITTERIP ?>: <?=$IP ?><br />
<?=$PROCESS_PROVIDER ?>: <?=$PROVIDER ?><br />
<?=$PROCESS_BROWSER ?>: <?=$BROWSER ?><br />
<?=$PROCESS_OPSYS ?>: <?=$OPSYS ?>
</p>

<p>
<?php if ($RECORD_ID != ''): ?>
<?=$PROCESS_RECORDSAVEDID?> <?=$RECORD_ID ?>
<?php endif; ?>
</p>
#2207
  • Moriwenne
  • Visitor
  • Visitor

Moriwenne replied the topic: Re:Custom email noHanstifications howto

Hey Hans

1. textarea in html version shows the text next to each other.
in the txt version when you enter several lines into the text area, the output is like you entered it, which is better of course.

Is there a way to change such behaviour in an html layout?

This happens exactly because of html. The file is interpreted like it is an html page. Html pages don't care about your hitting enter or space multiple times, only the <br /> creates a new line and only   creates a space. If you want to tweak it to your liking you should check some tutorials on html and use tables, with borders, without borders, to have the final appearance that you desire.


2. is there a trick to change mail subject to something else, for example the form name...


Yes there is. You have to go to the place where the subject is created.

Go to components\com_facileforms\facileforms.process.php

Open the file and go down to line 2947 (or do a find), to get to the function sendEmailNotification()

Inside that function you have the following line

$subject = BFText::_('PROCESS_FORMRECRECEIVED');

You need to substitute that line for

$subject = $this->formrow->title;

and you'll get the title of your form send as the subject of your email.

Good luck

Mori
#2210
  • Hans
  • Visitor
  • Visitor

Hans replied the topic: Re:Custom email noHanstifications howto

Thanks Mori.

1. concerning my quest replacing the line breaks in textarea with <br>

Found several solutions
PHP comes down to this
$fldtextArea_name = str_replace("<br>", "\n", $fldtextArea_name);
or
$text = eregi_replace("\n","<br>",$text);

Javascript
fldarticle_desc = replace(fldarticle_desc,chr(13),"<br>")

I have tried to add these lines somewhere in my form
a/ edit form, pieces for php and scripts for js
b/ textarea field itself, scripts
after submit,before, after form, before

None seem to work, maybe have to be hard coded in the core files of breezingforms?

2. changing the email subject worked like a charm, much better now.

You have been very helpful mori, saved allot of my time figuring it out...

thanks
#2215
  • Moriwenne
  • Visitor
  • Visitor

Moriwenne replied the topic: Re:Custom email noHanstifications howto

Just treat others like you would like to be treated.
I've been there, I'm still there, constantly trying to find answers in forums that provide none. I know how it can be a time saver if someone just provides a little help at the right time.

Best of luck with your endeavours :)

Mori
#2224
  • Posts: 27
  • Thank you received: 0

jimyjimjames replied the topic: Re:Custom email noHanstifications howto

Hi Guys

Just curiouse is there a way to manually pull each field, for example i need to display the email in like a time sheet format and need to pull in the variables for each field manually instead of having all of them pulled in by the same command.

i have inserted a table which should paint a picture of what i mean, i havent filled out all the fields just saturday but its meant to show that each area in the table has its own field ie sat date and fri date are 2 seperate fields.

Anyone got any ideas?


James Ashworth
Mediart Solutions
www.mediart.com.au
#2704
Attachments:
Moderators: ForumSupporttomeperica
Time to create page: 0.101 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