A clinical study compared the effect of oral ginger herb with topical ginger essential oil in reducing pain and severity of primary dysmenorrhea—menstrual pain in the absence of pelvic disease. Seventy women with moderate to severe primary dysmenorrhea were randomly assigned to receive 250 mg of powdered ginger herb or apply five drops of ginger oil to the lower abdomen without massage every six hours from two days before the start of menstruation through the first three days of menstruation. The intervention continued for three menstrual cycles. Both groups experienced reductions in pain severity and duration and need for oral pain relievers (mefenamic acid). The group that applied the essential oil reported greater reductions in pain severity and the same reduction in pain duration, but a slightly higher need for oral pain-relieving medication, when compared to oral ginger powder.
https://www.researchgate.net/publication/312196683_A_clinical_comparative_study_of_oral_and_topical_ginger_on_severity_and_duration_of_primary_dysmenorrhea

In my experience, herbal capsules and essential oils can be complementary. It would have been interesting to have an additional group that took both the supplement and applied the oil topically to determine if this provided even greater relief.