Yes you can drink coffee while wearing Invisalign.
As long as the coffee is not too hot then you can safely drink coffee or any other drink that is not too hot while wearing the Invisalign.
Too hot of drinks may mess up the Invisalign but as long as the drink is not too hot you can drink the coffee or other drink.
Also be sure to brush your teeth often to keep the teeth under the Invisalign clean and you could brush the Invisalign as well.
Just make sure to keep it clean and it should be okay.