Modifying campaigns
To modify a specific campaign, you use the NewslettersManager class. The following code modifies a campaign through the Native API.
public void ModifyCampaign(Guid id, string newName)
{
NewslettersManager manager = NewslettersManager.GetManager();
Campaign campaign = manager.GetCampaigns().Where(c => c.Id == id).SingleOrDefault();
if (campaign != null)
{
campaign.Name = newName;
manager.SaveChanges();
}
}
First, you initialize the NewslettersManager. Then, you must get the specified campaign. Finally, you modify the title and save the changes.
See Also