More actions
Nguyenduyan (talk | contribs) No edit summary |
Nguyenduyan (talk | contribs) No edit summary |
||
Line 49: | Line 49: | ||
Example 2: | Example 2: | ||
number GlobalEmail=1; | number GlobalEmail=1; | ||
number | number globalEmailRId=15548080; | ||
EmailAccount a = new EmailAccount(GlobalEmail, | EmailAccount a = new EmailAccount(GlobalEmail,globalEmailRId); | ||
print(a.ActualEmail); | print(a.ActualEmail);//[email protected] | ||
print(a.Address); | print(a.Address);//[email protected] | ||
print(a.Alias); | print(a.Alias);//An test | ||
print(a.Default); | print(a.Default);//False | ||
</source> | </source> | ||
Revision as of 07:36, 30 November 2016
EmailAccount
Represents an email account.
Constructors
- (int type "2: WebShop, 3: Support") - Instanciate an existing email account
- (string type "The part before the @") - Instanciate an existing global email account by name
- (int type "0: Resource, 1: GlobalEmail, 2: WebShop, 3: Support", int id "Resource id or global email resource id. Unused for webshop and support types") - Instanciate an existing email account
Methods
Properties
- string ActualEmail { get; set; } - Actual Email address
- string Address { get; set; } - Email address
- string Alias { get; set; } - Alias
- bool Default { get; } - Is this the default email account for the resource.
- bool IsGEA { get; } - Is the alias for a Global Email or not.
- string ObjectTypeName { get; } - The name of the type of object.
- int ResourceId { get; } - Id of account
- TypeInformation TypeInformation { get; } - Get information about this class.
- bool UseActualEmail { get; set; } - If true, the from email will be ActualMail. Otherwise, it will be Address.
Examples
Example 1:
number WebShop=2;
number Support=3;
EmailAccount a = new EmailAccount(Support);
print(a.ActualEmail);
print(a.Address);
print(a.Alias);
print(a.Default);
print(a.ResourceId);
//Result:
info@voxmeter.dk
Support@voxmeter.catglobe.com
Support
False
832
----------
Example 2:
number GlobalEmail=1;
number globalEmailRId=15548080;
EmailAccount a = new EmailAccount(GlobalEmail,globalEmailRId);
print(a.ActualEmail);//[email protected]
print(a.Address);//[email protected]
print(a.Alias);//An test
print(a.Default);//False
// EX for creating a new global email account
string name = "test";
EmailAccount a = new EmailAccount (1,0);
a.Address = name + a.Address;
a.Alias = name;
a.Save();
// EX for get global email without knowing current site domain.
EmailAccount a = new EmailAccount("test");
a.ActualEmail="[email protected]";
a.UseActualEmail =true;
a.Save();