How to debug Newsletter Studio during sending emails?

Is there a way to debug the NS at the point of sending emails?

We construct a list of EmailReceiver and they seem to be correct but GetDataModel is not getting hit for some list providers and the report shows 0 recipients despite the list returned containing the correct list of EmailReceiver.

Just to give an example of logs from GetReceiversForList:

This list GetDataModel’s hits correctly and emails are sent:

Receiver: EmailReceiver { Identifier: EmailReceiverIdentifier { ProviderPrefix: “subscribersAffiliatesByLastPasswordChange”, Identifier: “77135” }, Email: “…”, Name: “Han Omar” }

Provider Prefix: “subscribersAffiliatesByLastPasswordChange”; ListId: “member|Affiliate|en-GB|passwordChange:null”; Subscribers: 18; Receivers: 18

This list never hits GetDataModel for any subscriber and 0 emails are sent:

Receiver: EmailReceiver { Identifier: EmailReceiverIdentifier { ProviderPrefix: “subscribersClientsWithPromoCode”, Identifier: “23486” }, Email: “…”, Name: “Dell” }

Provider Prefix: “subscribersClientsWithPromoCode”; ListId: “subscriber|user|en-GB|promocode:newsletter-form”; Subscribers: 48; Receivers: 48

We have several lists that are working correctly and several that are not working. Any idea what to check/ log to investigate the issue? Currently, we do not have any means of debugging the sending stage, why the recipients from the list are selected for email and not receive emails.

We do not know whether this is an issue with the upgrade because in lower versions of Umbraco and NS, the sending was working. Or this is our implementation issue. Anyway, how to debug the sending stage?

Thanks

Versions

Umbraco version 17.2.2

Newsletter Studio version 17.0.6

@markusjoha

Hi @ewuski ,

Adding a debugging issues link. Please check:

Hope it helps!

Hi!

I think that the problem might in the length of the prefix, the identifiers would become very long and might not fit into the db-column.

Can you double check the logs (trace logs) when the sending queue is created, check the length of you identifiers and ensure that they fit into the db column.

Thanks. I believe the debugging mostly relates to tracking issues. We cannot track anything because emails are not sent at all.

We switched on Debug level logging, but that does not show anything suspicious, only “Newsletter Studio: Nothing to send, checking again soon.” and “Newsletter Studio campaign scheduler checking for work.” for the given campaign.

Which column are you talking about in particular?
The recipientLists column in the nsCampaignEmail table is ntext so accepts a long string, and the longest recipient identifier is 59 characters long and is not truncated in the nsTrackingCampaignEmail table.

Hi!

Thank you for letting me know reg. the debugging. Any unhandled exception should be logged but it is possible that it will just ignore unknown providers without throwing.

Just so that I understand you setup, you have two different Recipient List Providers:

  • subscribersAffiliatesByLastPasswordChange
  • subscribersClientsWithPromoCode

Is that correct?

Just to be clear, the “provider prefix” is intended to identify the provider, it needs to always be the same for RecipientListIdentifier and EmailReceiverIdentifier. The prefix is used to identify and instantiate the Recipient List Provider class.

Just want to ensure that you are saying that the GetLists() and GetReceiversForList() are called correctly but after this GetDataModel() is never called?

You are right in that nsCampaignEmail.recipientLists is ntext but there are more parts involved. When you select the lists to send to, these are stored as an array in nsCampaignEmail.recipientLists, after this the background worker should start to populate the queue (nsTrackingCampaignEmail). It will call GetReceiversForList() on the Recipient List Provider(based on the on the provider prefix on the EmailReceiverIdentifier) and store a new row in nsTrackingCampaignEmail. Here the providerRecipientId is nvarchar(255) hence the question about length.

After this, when the queue is processed, the GetDataModel() method will be called based on the provider prefix passing in the EmailReceiverIdentifier.

I would recommend that you:

  • Ensure that you’re using the same prefix for the provider as outlined above.
  • Ensure that the queue is corrected and that the nsTrackingCampaignEmail.providerRecipientId looks correct.

If you cannot identify the problem based on these steps I would need to see the code of the Recipient List Provider to be able to understand what is happening.

All the best!