how to use Smarty to write a text (ex. an e-mail)?

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

    how to use Smarty to write a text (ex. an e-mail)?

    Hallo,
    I'd like to use the power of Smarty for writing an e-mail.
    I mean: I have some field (or variables) and I like to create a template
    of an e-mail which can be modified simply modifing the code...
    like a web page whith its template.
    How can I do?
    Thank you in advance,
    Mario.
  • Bernhard Jaud

    #2
    Re: how to use Smarty to write a text (ex. an e-mail)?

    _mario.lat schrieb:
    Hallo,
    I'd like to use the power of Smarty for writing an e-mail.
    I mean: I have some field (or variables) and I like to create a template
    of an e-mail which can be modified simply modifing the code...
    like a web page whith its template.
    How can I do?
    Thank you in advance,
    Mario.
    Write your template e.g. email.tpl
    Assign the vars
    $tpl -assign('Name', $name);
    and fetch the Finished Template into a variable

    $body=$tpl -fetch('post_vie w.tpl');

    and then mail it

    mail($to,$subje ct,$body);

    HTH

    Bernhard

    --
    Some humans would do anything to see if it is possible to do it.
    If you would place a lager switch in some cave somewhere,
    saying "END-OF-THE-WORLD-SWITCH!! DO NOT TOUCH!!!",
    the paint wouldnt have time to dry.



    -Terry Pratchett

    Comment

    • Bernhard Jaud

      #3
      Re: how to use Smarty to write a text (ex. an e-mail)?

      _mario.lat schrieb:
      Hallo,
      I'd like to use the power of Smarty for writing an e-mail.
      I mean: I have some field (or variables) and I like to create a template
      of an e-mail which can be modified simply modifing the code...
      like a web page whith its template.
      How can I do?
      Thank you in advance,
      Mario.
      Write your template e.g. email.tpl
      Assign the vars
      $tpl -assign('Name', $name);
      and fetch the Finished Template into a variable

      $body=$tpl -fetch('email.tp l');

      and then mail it

      mail($to,$subje ct,$body);

      HTH

      Bernhard

      --
      Some humans would do anything to see if it is possible to do it.
      If you would place a lager switch in some cave somewhere,
      saying "END-OF-THE-WORLD-SWITCH!! DO NOT TOUCH!!!",
      the paint wouldnt have time to dry.



      -Terry Pratchett

      Comment

      Working...