Delete campaigns

Delete a single campaign

To delete a specific campaign, you use the NewslettersManager class. First, you initialize the NewslettersManager. You check whether an item with the specified ID exists. Then, you delete the campaign by calling DeleteCampaign. Finally, you save the changes.

The following code deletes a campaign with the specified ID with the Native API:

Delete all campaigns

To delete all campaigns, you use the NewslettersManager class. First, you initialize the NewslettersManager. You get all the available campaigns. Then, you iterate the collection deleting the campaigns one by one. Finally, you save the changes.

The following code deletes all available campaigns with the Native API:

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?