What would be the force law for the electric force between two electric charges in higher dimensions in the case of photons that have rest mass? I was reading about if photons have rest mass https://galileospendulum.org/2013/07/26/what-if-photons-actually-have-mass/, and found that if photons have mass the force law for the electric force between two electric charges, in 4+1 dimensions, would be $$F=\frac{Qq\left(1+{\mu}r\right)}{4{\pi}{\varepsilon_0}r^2e^{{\mu}r}}$$ and $$\mu=\frac{m_{\gamma}c}{\hbar}$$ with $Q$, and $q$ being the two electric charges, $r$ being the distance between the two electric charges, $\varepsilon_0$ being the electric constant, $m_{\gamma}$ being the rest mass of the photon, $c$ being the speed of massless particles, $\hbar$ being the reduced planks constant, and $F$ being the electric force between the two electric charges.
This equation can also be expressed as $$F={D_r}\left(\frac{Qq\left(sinh\left({\mu}r\right)-cosh\left({\mu}r\right)\right)}{4{\pi}{\varepsilon_0}r}\right)$$ $$F=\frac{Qq\left(D_r\left(sinh\left({\mu}r\right)-cosh\left({\mu}r\right)\right)r-\left(sinh\left({\mu}r\right)-cosh\left({\mu}r\right)\right)D_r(r)\right)}{4{\pi}{\varepsilon_0}r^2}$$ $$F=\frac{Qq\left(\left({\mu}cosh\left({\mu}r\right)-{\mu}sinh\left({\mu}r\right)\right)r-\left(sinh\left({\mu}r\right)-cosh\left({\mu}r\right)\right)\right)}{4{\pi}{\varepsilon_0}r^2}$$ $$F=\frac{Qq\left({\mu}rcosh\left({\mu}r\right)-{\mu}rsinh\left({\mu}r\right)-sinh\left({\mu}r\right)+cosh\left({\mu}r\right)\right)}{4{\pi}{\varepsilon_0}r^2}$$ $$F=\frac{Qq\left({u}rcosh\left({\mu}r\right)-sinh\left({\mu}r\right)-{\mu}rsinh\left({\mu}r\right)+cosh\left({\mu}r\right)\right)}{4{\pi}{\varepsilon_0}r^2}$$
I'm not sure if the force law in higher dimensions would be $$F=D_r\left(\frac{Qq\left(sinh\left({\mu}r\right)-cosh\left({\mu}r\right)\right)}{S{\varepsilon_{0}}r^{n-3}}\right)$$ or if it would be $$F=\frac{Qq\left(1+{\mu}r\right)}{S{\varepsilon_{0}}r^{n-2}e^{{\mu}r}}$$ or if it would be something else with, $n$ being the total number of dimensions and $S$, being what the radius of a sphere is multiplied to get the hyper-surface area in the number of dimensions minus one.  Also the units of $\varepsilon_0$ would depend on the number of dimensions.
What would be the force law for the electric force between two electric charges if photons are massive?
 A: $$[\ WARNING : This\ answer\ uses\ natural\ units\ $$ $$\ Use\ dimensional\ analysis\ to\ bring\ back\ any\ constants\ you\ need]$$
Let's jump right into the workings - which is basically an assumption and some integrations.
In $3+1$ dimension (without that time component, we wouldn't have a magnetic force, which will be bad and so we will talk about d+1 dimensions - although magnetism becomes complicated for higher dimensions, but that's a story for another day), Coulomb's law takes the form of an inverse-square law,
$$f = \frac{1}{r^2}$$
with proper definition of the source and distance.
Jumping dimensions :  
Time for our assumptions! We assume that the Lagrangian stays the same form in $d+1$ dimension.
$ -\ Massless\ calculations\ :\ $
It means, the Maxwell equations hold; or equivalently, the Poisson equation holds
$$\nabla^2 \varphi(\mathbf{x}) = 0$$
Solving $\varphi$ in free space will produce the potential and hence the force. By doing a Fourier transform,
$$\varphi(\mathbf{x}) = \int \frac{\mathrm{d}^d k}{(2\pi)^d} \frac{ e^{i \mathbf{k}\cdot \mathbf{x}}}{k^2}$$
Solving $\varphi(r)$
$$\varphi = \frac{1}{(2\pi)^d}\int \mathrm{d} k \; k^{d-3} \mathrm{d}^{d-1}\Omega {e^{i k r \cos \theta_1}}$$
where $\mathrm{d}^{d-1} \Omega$ is the $(d-1)-D$ angular element. Now this integral involves the integral of one azimuthal angle $\theta$. We can parametrize the coordinate in $d-D$ spherical coordinate as:
$$x_1 = r \cos\theta_1$$ $$x_2 = r \sin\theta_1 \cos\theta_2\cdots$$ $$x_d = r \sin\theta_1 \sin\theta_2\cdots \sin\theta_{d-2}\cos\phi$$
Then the surface element becomes: $$\mathrm{d}^{d-1} \Omega = \sin^{d-2}\theta_1 \sin^{d-3}\theta_2 \cdots \sin \theta_{d-2} \mathrm{d}\theta_1 \mathrm{d}\theta_2 \cdots \mathrm{d}\theta_{d-2} \mathrm{d} \phi$$ The integral over angles except $\theta_1$ is just the surface area of a $(d-2)-D\space hypersphere$ (Which I will assume you know, and so I am just stating the formula)
$$S_{d-2} = \frac{2 \pi^{\frac{d-1}{2}}}{\Gamma\left( \frac{d-1}{2} \right) }$$
So $$\varphi = \frac{ S_{d-2}}{ (2\pi)^d r^{d-2}} I_{d}$$ where
$I_d = \int_0^\infty \mathrm{d}\xi \; \int_0 ^\pi \mathrm{d}\theta \; \xi^{d-3} \sin^{d-2}\theta \exp\left[ i \xi \cos\theta \right]$
We can do the $\theta$ integral first(the other way around results in a tan integral with an argument of $\pi /2$, and is very very big and bad), which yields (I am using mathematica, please forgive me...):
$$I_d = \int_0^\infty \mathrm{d}\xi \; \sqrt{\pi} \Gamma\left( \frac{d-1}{2} \right) \frac{{ }_0F_1\left( \frac{d}{2}, -\frac{\xi^2}{4} \right)}{\Gamma\left( \frac{d}{2} \right)} \xi^{d-3} = 2^{d-3} \sqrt{\pi} \Gamma\left( \frac{d-2}{2} \right) \Gamma\left( \frac{d-1}{2} \right).$$
Therefore,
$$\varphi = \frac{ S_{d-2}}{ (2\pi)^d r^{d-2}} 2^{d-3} \sqrt{\pi} \Gamma\left( \frac{d-2}{2} \right) \Gamma\left( \frac{d-1}{2} \right) = \frac{\Gamma\left( \frac{d-2}{2}\right)}{4 \pi^\frac{d}{2} }\frac{1}{r^{d-2}}$$
$-\ Massful\ calculations\ :\ $ 
Now that we have easily solved for an intermediary massless boson, time to give it some mass. The Poisson equation becomes 
$$(\nabla^2 - m^2) \varphi(\mathbf{x}) = 0$$
By doing Fourier transform,
$$\varphi(\mathbf{x}) = \int \frac{\mathrm{d}^d k}{(2\pi)^d} \frac{ e^{i \mathbf{k}\cdot \mathbf{x}}}{k^2+m^2}$$
Apply the same technique as the massless counterpart
$$\varphi(r) = \frac{ (m r)^{\frac{d}{2}-1} K_{\frac{d}{2}-1} (mr)}{(2 \pi)^\frac{d}{2}}\frac{1}{ r^{d-2}}$$
where $K_n(x)$ is the Bessel function of the second kind.
To go from the potential to the force, you will need to differentiate this equation. This shouldn't be much of a problem, except the Bessel function.
The differentiation of the Bessel function yields :
$$K'_n(x) = - \frac{1}{2} [ K_{n-1} (x) + K_{n+1} (x)].$$  
Putting this in should give you the answer you seek.
Cheers!!
