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

public RelationshipMail CreateMail(
	Sale sale
)

Parameters

sale
Type: Sale
Sale, the mail is created for. Object. Access path: PublicAPI.CRM.Sale

Return Value

Type: RelationshipMail
Mail
Examples

//load a sale by ID 
var sale = PublicAPI.CRM.Sale.Load(3);

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

//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