Hi,
I have this issue with the cc at the end of letters. I want the user to be able to select from the existing contacts in the order, the ones he would like to cc, therefore I am using the FOREACH ASK option. But, and here is the problem, I want the text "cc" to show only when at least one addressee was selected. The way I see it, I can't put the cc within the FOREACH statement because then if the user is cceing more than one contact the word cc will appear more than once. Any suggestions?
Miri Yosef
cc in a letter
Re: cc in a letter
You can use the COUNT feature to help with this.
<VAR $Count (0)>
<FOREACH ASK {{Order.Contact}}><VAR $Count ({{$Count}} + 1)></FOREACH>
<IF ({{$Count}} > 1)>CC:
</IF>
<FOREACH ASK {{Order.Contact}}>
{{.Name}}
</FOREACH>
This will only prompt once for the ASK part because the ASK statements are exactly the same and it remembers the answers.
<VAR $Count (0)>
<FOREACH ASK {{Order.Contact}}><VAR $Count ({{$Count}} + 1)></FOREACH>
<IF ({{$Count}} > 1)>CC:
</IF>
<FOREACH ASK {{Order.Contact}}>
{{.Name}}
</FOREACH>
This will only prompt once for the ASK part because the ASK statements are exactly the same and it remembers the answers.
-
- Posts: 67
- Joined: Sun Oct 26, 2008 6:14 am
Re: cc in a letter
Brilliant! I had no idea VAR could respond to a FOREACH ASK statement.
Thank you very much.
Miri Yosef
Thank you very much.
Miri Yosef