Thursday, March 18, 2010

Updated Email Customer's Receipt example

I updated the "Email Customer's Receipt" example considerably. It retrieves business, receipt header, and receipt detail information from a SQL Server database.

I made most of the changes to the ASP code, and added T-SQL code to create tables and insert data into the example db_dermistest database. I included some code which should prevent SQL injection, as well.

If you're interested in a fairly complete example of using Dermis to email an invoice with information pulled from SQL Server, there you go. I hope it proves useful to you!

9 comments:

  1. Thanks very much for continuing work on this. I plan on using it very soon in a big way. I have a legacy CMS that I've been developing on and off over the last 10 years that's just crying out for a decent templating system. I'll keep you posted, but for now I just wanted to say thanks heaps!

    ReplyDelete
  2. Hi,
    Thanks for your work on this, do you have any documentation or "getting started" docs for this? I can't seem to find them.

    thanks

    ReplyDelete
  3. What if I want to include a stylesheet inside the template file for a dynamic template styling, for example:

    font-size: { $Font_Size };
    color: { $Color };

    ReplyDelete
  4. Hi Mikey,

    Sure thing! I hope it proves useful for you. Suggestions for improvements are welcome, too!

    ReplyDelete
  5. Hi John,

    If you navigate to dermis/docs/default.htm, click the "Quick Installation, Setup and Test" link on the left.

    Does this answer your question? ... or are you looking for more of a tutorial? I'm not sure if I'm really answering your question.

    ReplyDelete
  6. Hi Anonymous ("include a stylesheet inside"),

    Perhaps something like this will work:

    objT.assign "Font_Size", 12
    objT.assign "Color", "red"

    ReplyDelete
  7. Hi Anonymous ("include a stylesheet inside"),

    Update:

    I knee-jerked that response. After thinking about it for a bit, I have a solution, but not a pretty one.

    Right now, the only way is by using {$smarty.ldelim} and {$smarty.rdelim}. I'll work on that.

    <style>
    body {$smarty.ldelim}
    font-family: "Palatino Linotype","serif";
    font-size: {$smarty.ldelim} { $Font_Size } {$smarty.rdelim};
    color: {$smarty.ldelim} { $Color } {$smarty.rdelim};
    {$smarty.rdelim}
    </style>

    ReplyDelete
  8. Hi William,

    I'm the one who sent a question for StyleSheet and categories/articles issue, I found {literal}{/literal} in your docs to ignore template code and it also worked for me, thanks!

    I sent you the last message in docs post and I'm waiting to receive an email from you.

    Best Regards
    Kasem

    ReplyDelete
  9. Hi Kasem,

    I created a forum for Dermis users: http://forums.williammeitzen.com. Kindly post your questions and correspondence there. Thank you!

    ReplyDelete