cc in a letter

Discussions related to ReadyDoc development.
Post Reply
Miri Yosef
Posts: 67
Joined: Sun Oct 26, 2008 6:14 am

cc in a letter

Post by Miri Yosef »

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
swheatley
Posts: 26
Joined: Thu Sep 11, 2008 1:55 pm
Location: Raleigh, NC
Contact:

Re: cc in a letter

Post by swheatley »

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.
Miri Yosef
Posts: 67
Joined: Sun Oct 26, 2008 6:14 am

Re: cc in a letter

Post by Miri Yosef »

Brilliant! I had no idea VAR could respond to a FOREACH ASK statement.

Thank you very much.
Miri Yosef
Post Reply