If $A$ is not defective, then it can be decomposed as
$$\eqalign{
\def\Mi{M^{-1}} \def\Mt{M^T} \def\Mit{M^{-T}}
\def\k{\otimes} \def\h{\odot} \def\c{\cdot}
\def\LR#1{\left(#1\right)} \def\l{\lambda}
\def\Diag{\operatorname{Diag}}
\def\vc{\operatorname{vec}}
\def\p{\partial} \def\grad#1#2{\frac{\p #1}{\p #2}}
A &= M\,L\,\Mi\qquad\quad L = \Diag(\l_k) \\
}$$
and the Daleckii-Krein Theorem can be invoked to obtain the gradient
$$\eqalign{
B &= f(A) \\
dB &= M\Big(R\h\big(\Mi\,dA\,M\big)\Big)\Mi \\
\grad B{A_{ij}} &= M\Big(R\h\big(\Mi\,E_{ij}\,M\big)\Big)\Mi \\
}$$
where $(\h)$ is the Hadamard product and the components of the $E_{ij}$ matrix are all zero except for the $(i,j)$ component which is equal to one.
The components of the $R$ matrix are
$$\eqalign{
R_{k\ell}
\;=\; \begin{cases}
{\large\frac{f(\l_k)\,-\,f(\l_\ell)}{\l_k\,-\,\l_\ell}}\qquad{\rm if}\;\l_k\ne\l_\ell \\
\\
\quad{\small f'(\l_k)}\qquad\qquad{\rm otherwise} \\
\end{cases} \\
}$$
In the current problem, the function of interest is
$$ f(z) = f'(z) = \exp(z) $$
The above result can be flattened into a matrix-valued gradient
$$\eqalign{
\def\R{{\large\cal D}}
a &= \vc(A),\quad b= \vc(B),
\quad \color{red}{\R\equiv\Diag\big(\!\vc(R)\big)} \\
db &= \vc(dB) \;=\; \LR{\Mit\k M}\R\,\LR{\Mt\k\Mi}\, da \\
\grad ba &= \LR{\Mt\k\Mi}^{-1}\,\R\,\LR{\Mt\k\Mi} \\
}$$
A recent paper by Magnus extends this idea to defective matrices, but it is much more complicated.
On the other hand, if $A^T\!=A\,$ then the solution becomes much
simpler, since $M$ can be replaced by an orthogonal matrix
$$\eqalign{
\def\Qt{Q^T} \def\qiq{\quad\implies\quad}
A &= Q\,L\,Q^T, \qquad \Qt = Q^{-1} \\
\grad B{A_{ij}} &= Q\Big(R\h\big(\Qt\,E_{ij}\,Q\big)\Big)\Qt \\
\grad ba &= \LR{Q\k Q}\R\,\LR{Q\k Q}^T \\
}$$