Class EmailRecipient
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
Represents an email recipient.
public class EmailRecipient
- Inheritance
-
objectEmailRecipient
Constructors
EmailRecipient()
Creates an empty recipient
public EmailRecipient()
EmailRecipient(string)
Creates a recipient for the provided email address
public EmailRecipient(string recipientAddress)
Parameters
| Name | Type | Description |
|---|---|---|
recipientAddress |
string | The email address |
Remarks
Use FromString(string) to create a recipient from a string that contains an address and optional display name.
EmailRecipient(string, string)
Creates a recipient for the provided email address and display name
public EmailRecipient(string recipientAddress, string recipientName)
Parameters
| Name | Type | Description |
|---|---|---|
recipientAddress |
string | The email address |
recipientName |
string | The display name |
Remarks
Use FromString(string) to create a recipient from a string that contains an address and optional display name.
Properties
Address
The email address
public string Address { get; set; }
Property Value
- string
Remarks
The Address is required and must be a valid email address, though no validation is performed until the address is used on a message.
The Address can also be set to a job variable token (e.g., "%RecipientList%"), which is expanded when creating the notification message. The variable value can be either a single recipient or a list of recipients. See ParseAndAdd(string) for requirements for the format of recipients specified in a variable.
Name
The display name
public string Name { get; set; }
Property Value
- string
Remarks
Name is optional
RecipientType
Specifies how the recipient is added to the message
public MessageRecipientType? RecipientType { get; set; }
Property Value
Remarks
Set to null or Unspecified to use the default for the context.
Methods
Clone()
Creates a copy of the recipient
public EmailRecipient Clone()
Returns
CompareTo(EmailRecipient)
Compares this recipient to other
public int CompareTo(EmailRecipient other)
Parameters
| Name | Type | Description |
|---|---|---|
other |
EmailRecipient | The email recipient to compare to. |
Returns
- int
Remarks
This method compares only the Address.
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
| Name | Type | Description |
|---|---|---|
obj |
object | The object to compare with the current object. |
Returns
Remarks
This method compares only the Address.
FromString(string)
Creates a new EmailRecipient from a string that contains an email address and optional display name and recipient type
public static EmailRecipient FromString(string source)
Parameters
| Name | Type | Description |
|---|---|---|
source |
string | The string to parse |
Returns
- EmailRecipient
null if the
sourceis null or empty, otherwise an EmailRecipient parsed from thesource
Remarks
This method accepts a string of the form
[MessageRecipientType:][<DisplayName>] Address
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string representation of the recipient
public override string ToString()
Returns
- string
Remarks
If the Name has a value, ToString returns "<Name> Address". Otherwise it returns the Address. If RecipientType has a value other than Unspecified, the return value is prefixed with the RecipientType, e.g.,
<pre><code class="lang-csharp">CC:<Some Person> [email protected]</code></pre>