[verb (plain)] + 折に / 折には [noun] + の + 折に / 折には その + 折に / 折には
折に means "when", "on the occasion of": it picks out an occasion – a visit, a meeting, a trip – and says what happened then or what should happen then. A verb goes before it in the plain form, a noun with の. おり折 is a formal word for "time, occasion", and the pattern belongs to letters, business email and polite speech.
Because the register is formal, the verbs around 折に are usually honorific or humble: おあいしたお会いしたおり折, おこし越しのおり折, いらっしゃるおり折.
With は, 折には usually looks ahead to an occasion that may come – "if you are ever ~" – and the sentence ends in a request or an invitation. This is the commonest form in letters and email.
With a past verb, 折には recalls an occasion both sides know, usually to thank someone for it.
These go beyond 折に after a verb or a noun.
After その or あの, 折 points back to an occasion both sides know: "on that occasion".