Forums

Can I also send a confirmation to...

r.spilauer 07 Jul, 2007
Hello,

I'm rather new to this, so I hope I am not asking a question everybody knows the answer to.

I would like to know if I can send a confirmation email (apart from the email with the results of course) to an email address inserted by a user of the form with something like: "We received your registration in a name "fname" and address "faddress"."

So as a confirmation the applicant does not only see the page but receives automatic email but a little different than me with the results.

If this is a standard thing I appologize for asking, if it's already in the forum, just let me know.

Cheers

Radim
Max_admin 07 Jul, 2007
Hello,

Welcome to ChronoForms, First I want to tell that you are the first one to ask about this🙂

I see this as a good idea to put a straight easy way to do it in the next release, however you can achieve this in the current release with few lines of code :

#1- at the form edit page and on the "on submit AFTER email" code, put this :


<?php
$from = 'admin@admin.com';
$fromname = 'Radim';
$recipient = $_POST['email']; // here I assume that the field name which will have the user's email is "email"
$body = 'We received your registration in a name '.$_POST["fname"].' and address '.$_POST["faddress"];
mosMail($from, $fromname, $recipient, $subject, $body, true, NULL, NULL, NULL, NULL, NULL );
?>


This should do it for you, as you see, you have full flexibility over all variables and its just fun to play with some PHP lines🙂

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
r.spilauer 07 Jul, 2007
Brilliant, works like a charm. Thank you.

Now, I hope it is not too bold to ask but is there a way to format the mail into more lines and in html? To be honest I've checked the Internet first before asking but I am not too good in PHP so I don'r really know.

Cheers

Radim
r.spilauer 07 Jul, 2007
Sorry, it already is in HTML. Still I am not sure how to put more lines and some formatting along with the data from the form.

Thank you

Radim
r.spilauer 07 Jul, 2007
Well I keep posting. I've figured it out myself apart from one tiny little thing. I would like to change the font of the confirmation email to Tahoma. I've tried several html tags but noone seems to help.

Any idea?

Radim
Max_admin 07 Jul, 2007
Hi,

I think you can put the whole email in the email template into some div and give a style for the font like style = "font-family:....etc"
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 08 Jul, 2007
Hi Radim,

Getting formatting correct in e-mails is not always straight-forward as different e-mail programs treat the html formatting commands in different ways. Either the html <font face='Tahoma, sans-serif'>...</font> or the css <p style='font-family:Tahoma, sans-serif;'>. . .</p> should do the trick (if in doubt use both).

Bob
r.spilauer 09 Jul, 2007
Yep, it did the trick, thank you. What I did after all was I wrote the answer in TMEdit directly in Joomla, chose specific font and size, switched to HTML, cleaned the code a little and pasted it to the form. Worked fine.
GreyHead 09 Jul, 2007
Hi Radim,

I think that you can just put what you want in the $body statement something like this:
$body = "<div style='border:1px solid black;padding:6px;'><p>We received your registration in the name of <b>$_POST['fname']</b> and address $_POST['faddress']. </p></div>";
You'll need to watch the quotes but using double quotes for the whole string and single quotes inside it ought to work OK (otherwise you'll need to escape some).

Bob
This topic is locked and no more replies can be posted.