That's great! Please see here for purchase options. Currently the easiest and cheapest option is www.swissrailways.com/ en, where you can pick the "Online Ticket" delivery option. You'll receive the card through e-mail to print it at home, and you can immediately use it once in Switzerland.