Cal. Civ. Code § 1782
(a) Thirty days or more prior to the commencement of an action for damages pursuant to this title, the consumer shall do the following:
(2) Demand that the person correct, repair, replace, or otherwise rectify the goods or services alleged to be in violation of Section 1770.
The notice shall be in writing and shall be sent by certified or registered mail, return receipt requested, to the place where the transaction occurred or to the person’s principal place of business within California.
(c) No action for damages may be maintained under Section 1781 upon a showing by a person alleged to have employed or committed methods, acts, or practices declared unlawful by Section 1770 that all of the following exist: