Template WYSIWYG php && tags

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aggelos

    Template WYSIWYG php && tags

    Dear developers,
    I am trying to find an answer to that rpoblem of mine for a very long
    time now... and still I had no luck.

    I have my tinyMCE WYSIWYG and I want to let people create an e-mail
    template.
    So i want the to type in the WYSIWYG :
    Dear <?= $subscriber->name ?>,
    You have a message from <?= $anotherSubscri ber->name ?>
    Total messages: <?= $message->countMessages( $subscriber->name); ?>
    Regards,
    Hero

    Another version of the above is:
    Dear <?= $NAME ?>,
    You have a message from <?= $MESSAGE_FROM_N AME ?>
    Total messages: <?= $TOTAL_MESSAGES ?>
    Regards,
    Hero

    Ignore the CAPITAL letters.

    And the question is... what options do I have of creating that
    template in my WYSIWYG store it in a DB and then be able to parse it.
    I believe that the most common answer would be using regular
    expression and replacing this variables with somthing else. But do you
    know any application that works like that... is that a common way to
    work ?

    Thank you.

  • Bruno Barberi Gnecco

    #2
    Re: Template WYSIWYG php &amp;&amp; tags

    Aggelos wrote:
    Dear developers,
    I am trying to find an answer to that rpoblem of mine for a very long
    time now... and still I had no luck.
    >
    I have my tinyMCE WYSIWYG and I want to let people create an e-mail
    template.
    So i want the to type in the WYSIWYG :
    Dear <?= $subscriber->name ?>,
    You have a message from <?= $anotherSubscri ber->name ?>
    Total messages: <?= $message->countMessages( $subscriber->name); ?>
    Regards,
    Hero
    >
    Another version of the above is:
    Dear <?= $NAME ?>,
    You have a message from <?= $MESSAGE_FROM_N AME ?>
    Total messages: <?= $TOTAL_MESSAGES ?>
    Regards,
    Hero
    >
    Ignore the CAPITAL letters.
    >
    And the question is... what options do I have of creating that
    template in my WYSIWYG store it in a DB and then be able to parse it.
    I believe that the most common answer would be using regular
    expression and replacing this variables with somthing else. But do you
    know any application that works like that... is that a common way to
    work ?
    >
    Thank you.
    >
    Many do. Just search for 'templates php' and you'll see many
    examples. It is the most common way to do it. In fact, I can't see
    any other good way to do it.

    --
    Bruno Barberi Gnecco <brunobg_at_use rs.sourceforge. net>

    Comment

    Working...