Issue with Campaign problem to find distinct valid campaigns
Let $DP[i]$ be the number of distinct valid campaigns whose last marketing email is the $i$-th email, $i$ from $1$ to $n$. As an extension, let $DP[0]=1$, which is the number of distinct valid campaigns without marketing emails.

For all $i\le k+1$, it is clear that the only valid campaign whose last marketing email is the $i$-th email is the campaign that has no marketing email other than the $i$-th email. That is,
$$DP[i]= 1\quad\color{#d0d0d0}{\text{ for all }i\le k+1.}$$
For all $i\gt k+1$,

Consider a valid campaign $\mathcal C$,  whose last marketing email is the $i$-th email. If the last marketing email of $\mathcal C$ is changed to a transactional email, $\mathcal C$ will become another valid campaign, which does not have marketing email or whose last marketing email is one of the first $i-k-1$ emails.
Conversely, consider a valid campaign $\mathcal D$, which does not have marketing email or whose last marketing email is one of the first $i-k-1$ emails. If we change the $i$ email of $\mathcal D$ to a marketing email, $\mathcal D$ will still be a valid campaign, whose last marketing email is the $i$-th email.

So, we have
$$DP[i]= DP[0] + DP[1] + \cdots + DP[i-k-1]\quad\color{#d0d0d0}{\text{ for all }i&gt;k+1.}$$
The number of all distinct valid campaigns is
$$DP[0] + DP[1] + \cdots + DP[n].$$
If we implement the above approach to compute the array $DP$ iteratively, we can get an algorithm that runs in $O((n-k)^2)$ time and $O(n)$ space.

The algorithm above runs in time that is quadratic of $n$ when $k$ is not near $n$. It might not be fast enough when $n$ is large.
Let us do better. Since
$$DP[i+1]= DP[0] + DP[1] + \cdots + DP[i-k-1] + DP[i-k],$$
we have the following simpler recurrence relation,
$$DP[i+1]= DP[i] + DP[i-k]$$
for all $i\ge k+1$. Now we can write an algorithm that runs in $O(n)$ time and $O(k)$ space. 

Here is a sample implementation in Python. For simplicity, $O(n)$ space is used.
def ways(n, k):
    dp = [1] * (n + 1)

    for i in range(k + 1, n):
        dp[i + 1] = dp[i] + dp[i - k]

    print(dp)  # for educational purpose.
    return sum(dp)


def test():
    print(5, 0, ways(5, 0))
    print(5, 1, ways(5, 1))
    print(5, 2, ways(5, 2))
    print(5, 3, ways(5, 3))
    print(5, 4, ways(5, 4))
    print(5, 5, ways(5, 5))


test()