Seems to be a lot of duplicate logic here.

Perhaps rename `$customer` and `$recipient` such that one variable is suitable for both cases and then since the rest of the logic is identical it can be taken outside the if/else.