On January 16, 1917, the "Zimmermann Telegram" was sent from Germany to Mexico, stating in the event of the US entering World War I on the allied side, Mexico would be given Texas, Arizona, and New Mexico. The letter was intercepted by British intelligence and partially deciphered by the next day. It's release in March shifted US public opinion in favor of war against Germany. From the article:
"What was the Zimmermann Telegram?
Most historians agree that American involvement in World War I was inevitable by early 1917, but the march to war was no doubt accelerated by a notorious letter penned by German foreign secretary Arthur Zimmermann. On January 16, 1917, British code breakers intercepted an encrypted message from Zimmermann intended for Heinrich von Eckardt, the German ambassador to Mexico. The missive gave the ambassador a now-famous set of instructions: if the neutral United States entered the war on the side of the Allies, Von Eckardt was to approach Mexico’s president with an offer to forge a secret wartime alliance. The Germans would provide military and financial support for a Mexican attack on the United States, and in exchange Mexico would be free to annex “lost territory in Texas, New Mexico and Arizona.” In addition, Von Eckardt was told to use the Mexicans as a go-between to entice the Japanese Empire to join the German cause.
The British cryptographic office known as “Room 40” decoded the Zimmermann Telegram and handed it over to the United States in late-February 1917. By March 1, its scandalous contents were splashed on the front pages of newspapers nationwide. Diplomatic relations between Germany and the United States had already been severed in early February, when Germany resumed unrestricted submarine warfare and began preying on U.S. vessels in the Atlantic. While many Americans remained committed to isolationism—President Woodrow Wilson had only just won reelection using the slogan, “He kept us out of war”—the Zimmerman cipher now served as fresh evidence of German aggression. Coupled with the submarine attacks, it finally turned the U.S. government in favor of entering the fray. On April 2, 1917, President Wilson abandoned his policy of neutrality and asked Congress to declare war against Germany and the Central Powers. The United States would cast its lot with the Allies four days later."