Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Replace ',' with '<br>' or similar for html template

  1. #11
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Replace ',' with '<br>' or similar for html template

    Thanks! I'll watch for it.

    ginger

  2. #12
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Replace ',' with '<br>' or similar for html template

    Hi,

    OK, we've been thinking about this problem....

    One solution is to hard-code a specific list of supported values for template_list_sep. So, if you want "<br />" tags, you have to enter, say, "BR" in template_list_sep.

    The problem with that is that you cannot make up your own HTML to add in - we have to anticipate what anyone will ever want.

    It also doesn't solve the problem for people currently using <br> in their template_list_sep, when they upgrade to 8.23+ and their template stops working!

    The better solution is another setting in FormMail that allows you to provide your own substitutions. We'll provide some basic/default ones, and then you can add your own as well.

    It will look something like this:
    PHP Code:
    $TEMPLATE_SUBS = array(
      
    "NL" => "\r\n",
      
    "< *br */? *>" => "<br />",
      
    "< *p *>" => "</p><p>",
      ); 
    The values on the left are regular expressions that template_list_sep will be search for. A match means the value on the right is substituted.

    So, the above will work like this:
    HTML Code:
    <input type="hidden" name="template_list_sep" value="NL" />
    The list separator will be a carriage return followed by a line feed.

    HTML Code:
    <input type="hidden" name="template_list_sep" value="<br>" />
    <input type="hidden" name="template_list_sep" value="<br />" />
    The list separator will be an HTML BR tag. Either will work.

    HTML Code:
    <input type="hidden" name="template_list_sep" value="< p >" />
    The list separator will be an HTML paragraph close, followed by a paragraph open. This means the template would be expected to look like this:
    HTML Code:
    <p>Your preferred days are:</p>
    <p>$day_list</p>
    And that would expand like this:
    HTML Code:
    <p>Your preferred days are:</p>
    <p>Monday</p><p>Wednesday</p><p>Sunday</p>
    Apart from providing lots of flexibility, the main reason for allowing regular expressions in the matching is to solve the problem for people currently using HTML tags in their template_list_sep.

    A new version of FormMail will this feature should be released this coming week.

    I had a colleague of mine write a hook script (php) which puts html into the email template, but it also becomes encoded. I would be happy to email you the script and any other html files that you might like regarding the order form. I can't post the code here as it's still in production.
    Yes, I'd be interested to see this.

    I wasn't aware of your paid support, so from now on, when if I need formmail for complex project requirements, I can make room in the budget for any paid support. What are your prices? Do you have set rates?
    Support prices are found by going here.

    Those prices are different from consulting/programming prices, and if you're interested in getting a quote for any development work, please email me.

    Contact email addresses are here.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #13
    Join Date
    May 2011
    Posts
    7

    Default Re: Replace ',' with '<br>' or similar for html template

    Excellent news Russell, I'm glad it was something that was relatively easy to fix, and that others will also benefit.

    I have emailed support with the hook script you wanted to see.

    Looking forward to the imminent release of the updated formmail. Are you still on track for a release this week?

    Kind Regards,
    Damian

  4. #14
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Replace ',' with '<br>' or similar for html template

    Hi,

    Yes, I still expect the new version to be done this week.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #15
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Replace ',' with '<br>' or similar for html template

    Hi,

    Version 8.27 is now released and you can upgrade using the Upgrade Wizard.

    You should now be able to set your template_list_sep to "<br>" and it will work.

    Documentation updates are still to be done for the new $TEXT_SUBS setting that enables the above to work.
    Last edited by russellr; 21-May-2011 at 07:43 PM. Reason: missing word
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  6. #16
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Replace ',' with '<br>' or similar for html template

    Thanks Russell!

  7. #17
    Join Date
    May 2011
    Posts
    7

    Default Re: Replace ',' with '<br>' or similar for html template

    Hi Russell,

    Thanks so much, it's working perfectly!!

    Keep up the great work!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem loading HTML Error Template
    By Webz in forum FormMail Subscription Support
    Replies: 3
    Last Post: 26-Feb-2005, 08:50 PM
  2. HTML Template for Email could not be opened
    By gaso in forum FormMail Subscription Support
    Replies: 5
    Last Post: 11-Jan-2005, 11:53 PM
  3. Problem with HTML template
    By bmollon in forum FormMail Subscription Support
    Replies: 4
    Last Post: 25-Nov-2004, 10:46 PM
  4. External CSS Formatting of HTML Email Template
    By sebestyen in forum FormMail Subscription Support
    Replies: 2
    Last Post: 14-Oct-2004, 09:30 PM
  5. Subject=<no subject>?
    By Thomas in forum FormMail Subscription Support
    Replies: 2
    Last Post: 14-Jun-2004, 10:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •