Forums

Custom Auto responder email...

joayala 31 Jan, 2008
Hi all,

Can someone tell me how can I create my own html style email for auotoresponder?.

Thanks in advance
Jos
GreyHead 31 Jan, 2008
Hi Jos,

Sorry, I don't understand your question. What do you want in your email? and when do you want it sent?

I'd expect that you could just put your html into the email template box.

Bob
joayala 01 Feb, 2008
Thanks for your answer Bod,

Let me explain...

I have my form, I have my "Email template" for internal notification, but I don't have my "On Submit code - after sending email".

I want that my users could receive an email with my own design, but I don't know what king of labels, code or tags I must insert in my HTML template... I'm not a developer and I don't know PHP coding...:blush:

Regards
Jos
GreyHead 01 Feb, 2008
Hi Jos,

The email template is straightforward html. There are plenty of html tutorials on the web, or you can get someone to do it for you. The only thing that ChronoForms adds is that you need to place {field_name} where you want a form value to be included.

Here's a very basic example to get you started:
<p>Hi there,</p>
<p>Thank you for submitting our form.</p>
<p>Your name is {name}.</p>
<p>Your email is {email}.</p>
<p>Your IP address is {ip_address}.</p>
<p>Best wishes<br />
webmaster</p>
Bob
joayala 01 Feb, 2008
Hi Bob,

I think that I don't understand your answer or my question is not clear. I have this code in "On Submit code - after sending email" box...


<?php
$recipient = $_POST['email'];
$html_message = "
<p>Dear User,</p>
<p>Intro text.</p>
<p>Another text.</p>
<p>My Company name<br>
www.mysite.com<br><br>
My Telephone</p>";
$subject = $subject;
mosMail($from, $fromname, $recipient, $subject, $html_message, true );
?>


I took this code from a post of this forum, but when the email is sent to my user the email has not style.

My quiestion is... how can I insert or use my own design on this? even, I want to send it as personalized email... "Dear [user name]" instead of "Dear User".

Thanks
Jos
GreyHead 01 Feb, 2008
Hi Jos,

This code will show up on the 'Thank you' page that is returned after the form is submitted.

If you want to use an email template then you need to put the html in the Email Template box on the Form Code tab and set My Template in the drop down on the General Tab (sorry I forget what it's called but it's near the end of the tab).

Bob
joayala 01 Feb, 2008
Hi Bob,

Can I send you a PM to give you access to my site?, this because I actually have an email template to internal notification and all my doubts are about how to send to my users an email whit design after they submit the form.

Thanks a lot for your time.
Jos

BTW... I don't have configured any "Thank you" page.<br><br>Post edited by: joayala, at: 2008/02/01 01:04
GreyHead 01 Feb, 2008
Hi Jos,

Sure - there is no pm here but you can email me at the address in my sig.

I'm away from home at present and it may take a while before I can look at your site though.

Bob<br><br>Post edited by: GreyHead, at: 2008/02/01 13:19
GreyHead 03 Feb, 2008
Hi Jos,

I looked at your site and you have to do something slightly different to send a second email:[list]
  • $html_message has to include the whole of the email html
  • You can't use field-names but have to use <php? echo $_POST['field_name'] ?>.
  • With a long page like this you'll need to be very careful with quotes - I'd enclose the whole page string in single quotes so that you can safely use double quotes inside it without having to escape them all.
  • [/list]Here's a shortened version of your page with many lines skipped:
    <?php
    $recipient = $_POST['email'];
    $html_message = '<html>
    <head>
    <STYLE type="text/css">
    . . .
    </STYLE>
    </head>
    <body>
    <div align="center"><br>
    <table . . .>
    . . .
    <tr>
    <td>
    . . .
    Estmado(a) '.<?php echo $_POST['nombre']?>,
    . . .
    Su información ha sido recibida por nuestro sistema
    . . .
    </td>
    </tr>
    . . . 
    </table>
    </div>
    </body>
    </html>';
    mosMail($from, $fromname, $recipient, $subject, $html_message, true );
    ?>
    Bob<br><br>Post edited by: GreyHead, at: 2008/02/03 13:58
    Bloedi 06 Feb, 2008
    Hi..🙂 ..

    I don't understand the syntax you wrote
    <?php
    $recipient = $_POST['email'];
    $html_message = '<html>
    <head>
    <STYLE type="text/css">
    . . .
    </STYLE>
    </head>
    <body>
    <div align="center"><br>
    <table . . .>
    . . .
    <tr>
    <td>
    . . .
    Estmado(a) '.<?php echo $_POST['nombre']?>,
    On my webserver it is not possible to set a second PHP-script code in an other script syntax which was not already closed with ?>.
    The server replies with a syntax error if I try your script.

    Here is my test script
    <?php
    $recipient = $_POST['fromemail'];
    $html_message = '<html>
    <head>
    <STYLE type="text/css"> 
    </STYLE>
    </head>
    <body>
    <div align="center"><br>
    
    Hello <?php echo $_POST['fromname']?>
    
    </div>
    </body>
    </html>';
    mosMail($from, $fromname, $recipient, $subject, $html_message, true );
    ?>
    This code will not be executed from the engine.. and if I try this..
    <?php
    $recipient = $_POST['fromemail'];
    $html_message = '<html>
    <head>
    <STYLE type="text/css"> 
    </STYLE>
    </head>
    <body>
    <div align="center"><br>
    Hello <?php ?>
    </div>
    </body>
    </html>';
    mosMail($from, $fromname, $recipient, $subject, $html_message, true );
    ?>
    I got an e-mail with the real PHP script code. which means that the server has not executed the PHP code which is included in another PHP code.

    Is it realy possible to set code like this?
    <?php $recipient = $_POST['email'];
    <?php echo $_POST['fromname'] ?> ?>
    I think that's the reason why the server replies with a syntax error. : o( .

    Edited to add code tags<br><br>Post edited by: GreyHead, at: 2008/02/05 23:34
    GreyHead 06 Feb, 2008
    Hi Bloedi,

    Oops I got it wrong, you are right you can't nest tags like that.

    Just change the line to
    Estmado(a) '.$_POST["nombre"].',
    It's not terribly good coding to try to pack all this in a string - but it should work if the punctuation is OK.

    Bob
    Bloedi 06 Feb, 2008
    .. oh.. thank you.. :oD ..

    Now does it work..🙂 ..

    This smiley here iss funny.. :o) .. :woohoo: .. :oD ..
    joayala 07 Feb, 2008
    Thanks a lot for your help Bob,

    Now is working perfectly!...😉

    Regards
    Jos
    GreyHead 07 Feb, 2008
    Hi Jos & Bloedi,

    Glad it's working for you, sorry about the blooper on the way.

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