Send Emails from Frog CMS

November 28th, 2008

I needed a mailer backend which can handle complicated forms with any number of arbitary form fields. I also needed to be able to fully control the layout of sent emails. Something similar as oldie but goldie cgiemail.

Here comes Email Template plugin for Frog CMS.

It provides new page type called named Email template. You can POST your forms to this page type. Page contains the layout of the mail including the headers. Template then parses POST:ed data and sends the email.

To: Somebody <somebody@example.com>
From: <?php print $_POST['name'] ?> <<?php print $_POST['email'] ?>>
Subject: Frog Mail

1. Contact info

Name.............: <?php print $_POST['name'] ?> 
Company..........: <?php print $_POST['company'] ?> 
Email............: <?php print $_POST['email'] ?> 

2. Message

<?php print $_POST['message'] ?>

--
Sent by <?php print $_SERVER['REMOTE_ADDR'] ?>

Plugin assumes your PHP mail() function works properly. Currently it only supports plain text emails. Download and installation instructions at the project page. All feedback welcome.


6 Responses to “Send Emails from Frog CMS”

  1. hex says:

    the download link doesn’t work..please send me the right download link :(

  2. Mika Tuupola says:

    hex: Link is fixed now. Thanks for the heads up!

  3. hex says:

    yes it does work now, thanks. and another question…is there any kind of validation when sending e-mails?

  4. Mika Tuupola says:

    hex: Backend validation is in my TODO list. In the meanwhile you can use JavaScript validation (that is what I am using).

  5. TobMan says:

    Hi Mika,

    i really like your little neat plugin and would also like to use it in my site, but i did not really get it to work. It simply says that the email can not be send everytime…

    My form looks like: http://pastebin.com/m2220dc0c My Template like: http://pastebin.com/m3944d0b3

    For the template is did set up a none layout, which only containts html base tags and a $this-content() in the body… Ive done this because otherwise there wasnt a none-layout available in frog 0.95.

    Any ideas?

    Thanks ahead TobMan

  6. Mika Tuupola says:

    TobMan: If you know that your PHP is properly configured for sending email then I bet your HTML base tags are the sending. Just do a new layout with name none with following content:

    <?php echo $this->content(); ?>
    

    And then use that layout with your email template.

Leave a Reply



(will not be published)



(you can use Textile for formatting)