'String' has not been declared error

Regardless of whether or not you include the cpp file, it will be compiled separately.

So, look at JUST your cpp file. How is the compiler supposed to know what a String is?

If you #include Arduino.h in your header or source files, the problem will go away. That file is automatically added to your .ino file.