from Wikipedia:
After the sinking of seven US merchant ships by submarines and the publication of the Zimmermann telegram, [President] Wilson called for war on Germany, which the US Congress declared on 6 April 1917.
The Zimmermann Telegram was a secret diplomatic communication issued from the German Foreign Office in January 1917 that proposed a military alliance between Germany, Mexico and Japan in the event of the United States entering World War I against Germany. Mexico would be given Texas, Arizona and New Mexico. The proposal was intercepted and decoded by British intelligence. Revelation of the contents enraged American public opinion, especially after the German Foreign Secretary Arthur Zimmermann publicly admitted the telegram was genuine on 3 March, and helped generate support for the United States declaration of war on Germany in April. The decryption was described as the most significant intelligence triumph for Britain during World War I,and one of the earliest occasions on which a piece of signals intelligence influenced world events.