****SPOILERS BELOW****
If you want to know who did it and how you can read below. I will put it in white text so you should have to highlight with your mouse to get it.
*****
Sansa was involved but without her knowledge.
The knight that she helped saved by having Joffery turn the knight into the court fool. He was also the one who grabbed her while Joffery was choking and said to leave with him for her safety.
Remember he gave her what he said was his mother's necklace as a thank you for saving his life.
Now at the wedding ceremony Olenna Tyrell, the older lady and mother to Margery Tyrell, was talking to Sansa.
If you have this part DVRed or if you can watch it again, watch very closely. There are several jewels that hang down from the necklace. At one point Olenna is talking to Sansa and is messing with Sansa's hair and then the necklace. She takes one of the jewels off of the necklace and palms it. While she is doing all of this she is talking about how it is terrible to have someone killed at a wedding when she is talking about Sansa's brother Rob. But it is also a sly way of saying the Joffery is going to die at a wedding. After she moves her hand away from Sansa if you look close, and quickly, one of the jewels is missing from the top right side of the necklace. The jewel contained poison.
Later Joffery demands Tyrion to be the cup bearer. Tyrion hands him a cup. Joffery asks for wine in the cup. He then demands that Tyrion kneal before him. He says this a couple of times while Tyrion just stands there holding the cup. Margery defuses the situation by saying the PIE is here. Joffery grabs the cup, takes a Sip and hands it to Margery who puts it down on a table in front of her mother Olenna. The wine was not poisoned by Tyrion as Joffery took a quick sip and did not show signs of being poisoned.
So It is either Margery or Olenna. Now from the show you can not see either person put the poison into the drink but we know it was one of those two.
So Joffery orders Tyrion to bring his wine and Tyrion goes over to the table where Margery put it and hands it to Joffery and we know what happens when Joffery drinks the poisoned wine.
Now in the book...
Littlefinger...yes Littlefinger...arranges for the knight turned court jester to give the necklace to Sansa and in turn Olenna knows about it as she is the one who takes the jewel and puts the poison in the cup.
She knows that nobody would expect her or her daughter of doing it and her daughter is now Queen since she already married Joffery.