Modifying message bodies

To modify a specific message body, you use the NewslettersManager class. The following code modifies a message body through the Native API.

public void ModifyMessageBody(Guid id, string newName, string newBodyText)
{
    NewslettersManager manager = NewslettersManager.GetManager();
 
    MessageBody messageBody = manager.GetMessageBodies().Where(b => b.Id == id).SingleOrDefault();
 
    if (messageBody != null)
    {
        messageBody.Name = newName;
        messageBody.BodyText = newBodyText;
 
        manager.SaveChanges();
    }
}

First, you initialize the NewslettersManager. Then, you get the specified message body. Finally, you modify the title and the body text, and save the changes.

See Also

Other Resources

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK