An observant Jewish drug dealer who was part of a gang that texted customers to say they’d be closing shop early in honor of Shabbat will spend up to five years behind bars.

Edward Sorin, 38, of Sheepshead Bay was sentenced in Manhattan Supreme Court Tuesday to 5 years on a weapons possession charge for having a sawed-off shotgun and 3 ½ years on drug possession charge, terms that will run concurrently.

Judge Michael Sonberg also ordered that Sorin remain on supervised release for five years after he is freed.

Prosecutors said Sorin and four others operated a ring that dealt hundreds of thousands of dollars worth of oxycodone, heroin and cocaine from a drug den on Bedford Avenue.

They were busted last April 20 after investigators said they had texted customers with instructions about how to pick up their drugs of choice — and even warned them not to show up after sundown on a Friday or before sundown on Saturday.

“We are closing 7:30 on the dot and we will reopen Saturday 8:15 so if u need anything you have 45 mins. to get what you want,” one of the messages read, according to a criminal complaint.

Prosecutors said they used a variety of schemes to obtain the narcotic pills, including using stolen prescription sheets.

Cops raided the operation after a six-month investigation dubbed “Only After Sundown,” in which police seized about 900 glassines of heroin, 335 oxycodone pills, a small quantity of cocaine as well as the prescription drugs Xanax, Suboxone and Klonopin.

A sawed-off shotgun with ammunition was also recovered, as was a Blackberry that was used to send texts to customers, prosecutors charged.