PublicAPI.CRM.Relationship.CreateMail ELMA API Documentation
Create Mail for a lead. Creates an object without saving to the database
 
 
Syntax

public RelationshipMail CreateMail(
	Lead lead
)

Parameters

lead
Type: Lead
Lead, the mail is created for. Object. Access path: PublicAPI.CRM.Lead

Return Value

Type: RelationshipMail
Mail
Examples

//load a relationship by ID 
var lead = PublicAPI.CRM.Lead.Load(3);

//create mail 
var myMail = PublicAPI.CRM.Relationship.CreateMail(lead);

//myMail - created mail 

//WARNING!! Mail is created without a name. For correct work with the mail, you should 
//specify its name and sabe the object to the database
myMail.Theme = "Mail Name";
myMail.Save();
See Also