dotmailer SDK: dotMailer.Sdk.ContactFactory Class Reference

dotmailer SDK

dotmailer SDK
Tools to access and manage an account in the dotMailer system
dotMailer.Sdk.ContactFactory Class Reference

Contact Factory - Provides functions to manage contacts More...

Inheritance diagram for dotMailer.Sdk.ContactFactory:

Public Member Functions

DmAddressBookCollection ListAddressBooksForContacts (string contactEmail)
 Returns an IEmmerable interface to a list of address book that contain the specified contact
 
bool CreateDataField (string name, DmDataFieldTypes dataType, object defaultValue)
 Creates a new data field that is used by all of the contacts
 
bool DeleteDataField (string dataFieldName)
 Deletes the specified data field
 
DmContactCollection ListUnsubscribedContactsSinceDate (DateTime sinceDate)
 Returns a list of contacts that have unsubscribed, since the specified date
 
DmContactCollection ListContactsModifiedSinceDate (DateTime sinceDate)
 Retrieves a list of contacts who were modified on or after a given date.
 
DmContactCollection ListModifiedContacts (DateTime startDate, DateTime endDate)
 Retrieves a list of contacts that were modified between two specified dates.
 
DmContactCollection ListNewContactsSinceDate (DateTime sinceDate)
 Returns a collection of contacts that have been added to the dm account since the specified date
 
DmContact GetContact (int contactId)
 Gets a contact based on the specified contact Id
 
DmContact GetContact (string contactEmail)
 Gets a contact based on it's emailAddress address
 
bool UpdateContact (IDmContact iContact)
 Updates the specified contact
 
ImportContactResult UpdateContactsViaImport (ImportContactOptions importOptions, IEnumerable< IDmContact > contacts)
 Updates contacts that are specified in the list
 
DmContactCollection GetImportedContacts (ImportContactResult importResult)
 Gets the contacts that were imported, using the result from the import process+
 
DmContact CreateNewDmContact (string emailAddress)
 Creates a new DmContact ready for use
 
DmContact CreateContact (IDmContact contact)
 Creates a contact, from the specified interface. This will add the contact to the account, and use an api call to do so.
 
DmContact CreateContact (string emailAddress)
 Create a contact, based on the specified emailAddress address, and adds it to the dotMailer account
 
DmSuppressedContactCollection ListSuppressedContactsSinceDate (DateTime sinceDate)
 Returns a collection of contacts that appear in the suppression list
 
DmDataFieldValueCollection GetDefaultEmptyDataFieldValues ()
 Returns an collection of empty data field value and correspond to the data fields in the dotMailer account.
 
bool RemoveContact (int contactId)
 Removes a contact based on contact Id
 
bool RemoveContact (string contactEmail)
 Removes a contact from the dotMailer account
 
DmContactCollection ListAllContacts ()
 Lists all the contacts in the dotMailer account, by accessing the special 'All Contacts' address book
 
ResubscribeContactResult ResubscribeContact (IDmContact contact, IDmAddressBook addressBook, string preferredLocale, string returnUrlToUseIfChallenged)
 Resubscribes a contact who is currently unsubscribed. Not all contacts are permitted to resubscribe.
 
SuppressionCause GetContactStatusByEmailAddress (string emailAddress)
 Returns the current status of the contact associated with email address passed.
 
DmContactCollection ListHardBouncingContactsWithDataFields (int campaignId, params string[] dataFieldNames)
 Retrieves a list of all the contacts that hard bounced when sent a specified campaign, including the data field values specified.
 
DmContactCollection ListHardBouncingContactsWithDataFields (IDmCampaign campaign, params string[] dataFieldNames)
 Retrieves a list of all the contacts that hard bounced when sent a specified campaign, including the data field values specified.
 
DmCampaignContactLinkClickCollection GetCampaignClicksForContact (int campaignId, int contactId)
 Retrieves the collection of clicks for the contact with the specified Id, for the campaign with the specified id
 

Properties

DmDataFieldDefinitionCollection DataFieldDefinitions [get]
 Gets the data field definitions
 

Detailed Description

Contact Factory - Provides functions to manage contacts

Member Function Documentation

DmContact dotMailer.Sdk.ContactFactory.CreateContact ( IDmContact  contact)

Creates a contact, from the specified interface. This will add the contact to the account, and use an api call to do so.

The ImportContactsIntoAddressBook is a safer call for adding multiple contacts

AddressBookFactory.ImportContactsIntoAddressBook

Parameters
contactthe IDmContact interface
Returns
The new DmContact
Exceptions
DmException
DmContact dotMailer.Sdk.ContactFactory.CreateContact ( string  emailAddress)

Create a contact, based on the specified emailAddress address, and adds it to the dotMailer account

Parameters
emailAddressthe emailAddress address
Returns
The new DmContact
Exceptions
DmException
bool dotMailer.Sdk.ContactFactory.CreateDataField ( string  name,
DmDataFieldTypes  dataType,
object  defaultValue 
)

Creates a new data field that is used by all of the contacts

Parameters
nameName of the data field
dataTypeData Type of the data field
defaultValueDefault value for the data field
Returns
Exceptions
DmException
DmContact dotMailer.Sdk.ContactFactory.CreateNewDmContact ( string  emailAddress)

Creates a new DmContact ready for use

Parameters
emailAddressthe emailAddress address of the contact
Returns
Exceptions
DmException
bool dotMailer.Sdk.ContactFactory.DeleteDataField ( string  dataFieldName)

Deletes the specified data field

Parameters
dataFieldNameThe name of the data field to delete
Returns
true if the data field was deleted
Exceptions
DmException
DmCampaignContactLinkClickCollection dotMailer.Sdk.ContactFactory.GetCampaignClicksForContact ( int  campaignId,
int  contactId 
)

Retrieves the collection of clicks for the contact with the specified Id, for the campaign with the specified id

Parameters
campaignIdId of the campaign
contactIdId of the contact
Returns
DmCampaignContactLinkClickCollection
DmContact dotMailer.Sdk.ContactFactory.GetContact ( int  contactId)

Gets a contact based on the specified contact Id

Parameters
contactIdThe id of the contact of interest
Returns
DmContact
Exceptions
DmException
DmContact dotMailer.Sdk.ContactFactory.GetContact ( string  contactEmail)

Gets a contact based on it's emailAddress address

Parameters
contactEmailThe emailAddress address of the contact of interest
Returns
DmContact
Exceptions
DmException
SuppressionCause dotMailer.Sdk.ContactFactory.GetContactStatusByEmailAddress ( string  emailAddress)

Returns the current status of the contact associated with email address passed.

Parameters
emailAddress
Returns
DmDataFieldValueCollection dotMailer.Sdk.ContactFactory.GetDefaultEmptyDataFieldValues ( )

Returns an collection of empty data field value and correspond to the data fields in the dotMailer account.

This can be used to get the right data field value collection when implementing the IDmContact interface

Returns
DmDataFieldValueCollection
DmContactCollection dotMailer.Sdk.ContactFactory.GetImportedContacts ( ImportContactResult  importResult)

Gets the contacts that were imported, using the result from the import process+

Parameters
importResult
Returns
DmAddressBookCollection dotMailer.Sdk.ContactFactory.ListAddressBooksForContacts ( string  contactEmail)

Returns an IEmmerable interface to a list of address book that contain the specified contact

Parameters
contactEmailThe email address address of the contact
Returns
DmContactCollection dotMailer.Sdk.ContactFactory.ListAllContacts ( )

Lists all the contacts in the dotMailer account, by accessing the special 'All Contacts' address book

Returns
DmContactCollection
Exceptions
DmException
DmContactCollection dotMailer.Sdk.ContactFactory.ListContactsModifiedSinceDate ( DateTime  sinceDate)

Retrieves a list of contacts who were modified on or after a given date.

Parameters
sinceDateThe earliest modification date for which to return contacts.
Returns
DmContactCollection
Exceptions
DmException
DmContactCollection dotMailer.Sdk.ContactFactory.ListHardBouncingContactsWithDataFields ( int  campaignId,
params string[]  dataFieldNames 
)

Retrieves a list of all the contacts that hard bounced when sent a specified campaign, including the data field values specified.

Parameters
campaignIdThe campaign sent to the contacts.
dataFieldNamesThe data fields to be included in each contact.
Returns
A collection of contacts.
DmContactCollection dotMailer.Sdk.ContactFactory.ListHardBouncingContactsWithDataFields ( IDmCampaign  campaign,
params string[]  dataFieldNames 
)

Retrieves a list of all the contacts that hard bounced when sent a specified campaign, including the data field values specified.

Parameters
campaignThe campaign sent to the contacts.
dataFieldNamesThe data fields to be included in each contact.
Returns
A collection of contacts.
DmContactCollection dotMailer.Sdk.ContactFactory.ListModifiedContacts ( DateTime  startDate,
DateTime  endDate 
)

Retrieves a list of contacts that were modified between two specified dates.

Parameters
startDateThe start date of the range.
endDateThe end date of the range.
Returns
DmContactCollection
DmContactCollection dotMailer.Sdk.ContactFactory.ListNewContactsSinceDate ( DateTime  sinceDate)

Returns a collection of contacts that have been added to the dm account since the specified date

Parameters
sinceDateThe date to start the list from
Returns
DmContactCollection
Exceptions
DmException
DmSuppressedContactCollection dotMailer.Sdk.ContactFactory.ListSuppressedContactsSinceDate ( DateTime  sinceDate)

Returns a collection of contacts that appear in the suppression list

Returns
Exceptions
DmException
DmContactCollection dotMailer.Sdk.ContactFactory.ListUnsubscribedContactsSinceDate ( DateTime  sinceDate)

Returns a list of contacts that have unsubscribed, since the specified date

Parameters
sinceDatethe start date
Returns
DmContactCollection
Exceptions
DmException
bool dotMailer.Sdk.ContactFactory.RemoveContact ( int  contactId)

Removes a contact based on contact Id

Parameters
contactIdid of the contact to remove
Returns
bool dotMailer.Sdk.ContactFactory.RemoveContact ( string  contactEmail)

Removes a contact from the dotMailer account

Parameters
contactEmailemailAddress address of contact
Returns
ResubscribeContactResult dotMailer.Sdk.ContactFactory.ResubscribeContact ( IDmContact  contact,
IDmAddressBook  addressBook,
string  preferredLocale,
string  returnUrlToUseIfChallenged 
)

Resubscribes a contact who is currently unsubscribed. Not all contacts are permitted to resubscribe.

Parameters
contactThe contact you wish to resubscribe. Any custom data in this object will be added as well.
addressBookThe book to add the contact to (if the contact is challenged, they'll only be added after responding to the challenge)
preferredLocaleThe locale of the contact (such as en-GB or en-US). If the one supplied isn't available in dotMailer, it will fall back to en-GB.
returnUrlToUseIfChallengedIf the contact is challenged before being permitted to resubscribe, this is the page they'll end up on if they successfully complete the resubscribe.
Returns
ContactAdded, ContactChallenged or ContactCannotBeUnsuppressed
bool dotMailer.Sdk.ContactFactory.UpdateContact ( IDmContact  iContact)

Updates the specified contact

WARNING -> Will use an api call for each contact

Parameters
iContactinterface to the contact information
Returns
Exceptions
DmException
ImportContactResult dotMailer.Sdk.ContactFactory.UpdateContactsViaImport ( ImportContactOptions  importOptions,
IEnumerable< IDmContact contacts 
)

Updates contacts that are specified in the list

Creates a temporary address book, imports the contacts, deletes the address book

Parameters
importOptionsImportOptions
contactsIEnumerable interface to list of contacts to add
Returns

Property Documentation

DmDataFieldDefinitionCollection dotMailer.Sdk.ContactFactory.DataFieldDefinitions
get

Gets the data field definitions

Generated by   doxygen 1.8.3