We consider the location and order of capillary condensation transitions occurring in deep grooves of width L and depth D. For walls that are completely wet by liquid (contact angle θ=0) the transition is continuous and its location is not sensitive to the depth of the groove. However, for walls that are partially wet by liquid, where the transition is first order, we show that the pressure at which it occurs is determined by a modified Kelvin equation characterized by an edge contact angle θ_{E} describing the shape of the meniscus formed at the top of the groove. The dependence of θ_{E} on the groove depth D relies, in turn, on whether corner menisci are formed at the bottom of the groove in the low density gaslike phase. While for macroscopically wide grooves these are always present when θ<45° we argue that their formation is inhibited in narrow grooves. This has a number of implications including that the local pinning of the meniscus and location of the condensation transition is different depending on whether the contact angle is greater or less than a universal value θ^{*}≈31°. Our arguments are supported by detailed microscopic density functional theory calculations that show that the modified Kelvin equation remains highly accurate even when L and D are of the order of tens of molecular diameters.