You need something to anchor the pigtail to the housing, so that if it gets yanked on, the force is transferred from the cable to the case, not to the individual wires and connectors. The clamp connector shown in the instructables link would work fine. A cable gland does the same thing, but is (usually) also waterproof, with a rubber seal that is squeezed around the cable as the nut it tightened. See -
Cable gland - Wikipedia
Re 1 ft vs 4 ft, the only really issue I can see with a longer cable is a greater risk of it being yanked, tripped over, etc. The National Electric Code limits it to 1 foot, likely for this reason. But there are tons of wall connectors with 4 ft Home Depot range cords attached. I have an OpenEVSE with one connected to it. See
@FlasherZ's FAQ here (search for "can I attach a cord") -
FAQ: Home Tesla charging infrastructure Q&A