A perfect t-code in a graph Γ is a subset C of V( Γ) such that every vertex of Γ is at a distance not more than t, to exactly one vertex of C. In this paper, we present a new family of perfect t-codes in Cayley graphs of groups. We proposed the role of the subgroups of a group to create perfect t-codes by restricting the elements of the left transversal of the subgroups in the given group. Also, we introduce a new decoding algorithm for the all of perfect t-codes in Cayley graphs. These codes are able to correct every t-error pattern.