Open beriniwlew opened 6 years ago
I was able to reproduce this error with the following code:
var mailingId = await client.Mailings.CreateAsync(userKey, "Integration Testing", null, MailingType.Recurring, null, null, null, clientId).ConfigureAwait(false);
var updated = await client.Mailings.UpdateAsync(userKey, mailingId, type: MailingType.Standard).ConfigureAwait(false);
As you can see, I create a recurring mailing and then I try to change it to a standard mailing and CakeMail doesn't allow this.
This is not a problem with this library, it's simply that CakeMail doesn't allow you to change the type from recurring to standard. I suggest you contact CakeMail and explain to them why you want to change the type of your mailing and hopefully they will be willing to change their API to allow you to do this.
I was also able to reproduce by updating a mailing with the same type as was used when the mailing was created:
var mailingId = await client.Mailings.CreateAsync(userKey, "Integration Testing", null, MailingType.Standard, null, null, null, clientId).ConfigureAwait(false);
var updated = await client.Mailings.UpdateAsync(userKey, mailingId, type: MailingType.Standard, clientId: clientId).ConfigureAwait(false);
I was also able to reproduce by omitting the type when creating the mailing and then setting the type to 'standard' when updating the mailing.
var mailingId = await api.Mailings.CreateAsync(userKey, "Integration Testing", clientId: clientId).ConfigureAwait(false);
var updated = await api.Mailings.UpdateAsync(userKey, mailingId, type: MailingType.Standard, clientId: clientId).ConfigureAwait(false);
Clearly CakeMail doesn't like when we attempt to update a mailing and the 'type' is a non-null value.
I was also able to reproduce by updating a mailing with the same type as was used when the mailing was created:
This example of your create/update with Standard mailing is exactly what we are experiencing.
Why are you updating the mailing type with the exact same value?
I would like to hear from CakeMail to understand why we are getting an exception, but in the mean time you can work around this issue by omitting the value so it doesn’t get updated.
I heard back from CakeMail today and they confirmed there’s a bug in their API when you try to update the type of an existing mailing to “standard”. They told me they would publish an update tomorrow to resolve this bug.
I ran tests this morning and still getting the same Non recurring mailing!
exception so I guess they didn't publish the fix yesterday. With Christmas only a few days away, I doubt they will publish until early January.
The error message is: "Non recurring mailing!" Stack Trace:
Json