Difference between revisions of "EmailAccount class"
CGHelpdesk (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>Empty</nowiki> |Description=<nowiki>The Empty object</nowiki> |Methods= {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToStri...") |
|||
(16 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
− | |Name=<nowiki> | + | |Name=<nowiki>EmailAccount</nowiki> |
− | |Description=<nowiki>The | + | |Description=<nowiki>Represents an email account.</nowiki> |
+ | |InheritsFrom=object|Constructors= | ||
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=int|Name=<nowiki>type</nowiki>|Description=<nowiki>2: WebShop, 3: Support</nowiki>}} | ||
+ | |Description=<nowiki>Instanciate an existing email account</nowiki>}} | ||
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=string|Name=<nowiki>type</nowiki>|Description=<nowiki>The part before the @</nowiki>}} | ||
+ | |Description=<nowiki>Instanciate an existing global email account by name</nowiki>}} | ||
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=int|Name=<nowiki>type</nowiki>|Description=<nowiki>0: Resource, 1: GlobalEmail, 2: WebShop, 3: Support</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>id</nowiki>|Description=<nowiki>Resource id or global email resource id. Unused for webshop and support types</nowiki>}} | ||
+ | |Description=<nowiki>Instanciate an existing email account</nowiki>}} | ||
|Methods= | |Methods= | ||
− | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the Email Account</nowiki>}} |
+ | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} | ||
|Properties= | |Properties= | ||
+ | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ActualEmail</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Actual Email address</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Address</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Email address</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Alias</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Alias</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>Default</nowiki>|HasGetter=1|Description=<nowiki>Is this the default email account for the resource.</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>IsGEA</nowiki>|HasGetter=1|Description=<nowiki>Is the alias for a Global Email or not.</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | ||
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}} | + | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>Id of account</nowiki>}} |
+ | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>UseActualEmail</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>If true, the from email will be ActualMail. Otherwise, it will be Address.</nowiki>}} | ||
}} | }} | ||
+ | |||
+ | === Examples<br/> === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | 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); | ||
+ | print(a.Address);//test@cghead.catglobe.com | ||
+ | print(a.Alias); | ||
+ | print(a.Default); | ||
+ | |||
+ | </source> | ||
+ | |||
+ | <br/><source lang="javascript"> | ||
+ | // 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"); | ||
+ | </source> |
Latest revision as of 05:13, 23 March 2022
EmailAccount
Represents an email account.
Parent class
Inherits from object
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
- Empty Save() - Save the Email Account
- (From object) string ToString() - The string representation of the object.
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
- (From object) 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);
print(a.Address);//test@cghead.catglobe.com
print(a.Alias);
print(a.Default);
// 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");