Jump to:

3445 Posts in 1031 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » If blocks in email templates?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 871 Views
  • plautzer
    Avatar
    Community Member
    7 Posts

    If blocks in email templates? Link to this post

    Hello,

    is there a way to use if statements in email submussion forms? When I use the template if blocks:

    <% if $checkbox %> Write Hello <% end_if %>

    I always get follwoing error:

    Parse error: syntax error, unexpected '}' in ../email_template.ss on line 107

    Do u know how to get this to work?

    thx,
    Plautzer

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: If blocks in email templates? Link to this post

    In the templating language one doesn't use $ to assign variables / functions within the opening and closing brackets (<% %>)

    So it is like this:

    <% if checkbox %>
    $Message
    <% end_if %>

    871 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.