Module: Campaigning

Includes:
ModuleMixin
Defined in:
lib/campaigning/list.rb,
lib/campaigning/client.rb,
lib/campaigning/campaign.rb,
lib/campaigning/template.rb,
lib/campaigning/subscriber.rb,
lib/campaigning/campaigning.rb,
lib/campaigning/module_mixin.rb,
lib/campaigning/soap/generated/default.rb,
lib/campaigning/soap/generated/defaultDriver.rb,
lib/campaigning/soap/generated/defaultMappingRegistry.rb

Defined Under Namespace

Modules: DefaultMappingRegistry, ModuleMixin Classes: AnyType, ApiSoap, ArrayOfCampaign, ArrayOfClient, ArrayOfList, ArrayOfListCustomField, ArrayOfString, ArrayOfSubscriber, ArrayOfSubscriberBounce, ArrayOfSubscriberClick, ArrayOfSubscriberClickedLink, ArrayOfSubscriberCustomField, ArrayOfSubscriberOpen, ArrayOfSubscriberUnsubscribe, ArrayOfTemplate, Campaign, CampaignCreate, CampaignCreateResponse, CampaignDelete, CampaignDeleteResponse, CampaignGetBounces, CampaignGetBouncesResponse, CampaignGetLists, CampaignGetListsResponse, CampaignGetOpens, CampaignGetOpensResponse, CampaignGetSubscriberClicks, CampaignGetSubscriberClicksResponse, CampaignGetSummary, CampaignGetSummaryResponse, CampaignGetUnsubscribes, CampaignGetUnsubscribesResponse, CampaignSend, CampaignSendResponse, CampaignSummary, Client, ClientAccessAndBilling, ClientBasicDetails, ClientCreate, ClientCreateResponse, ClientDelete, ClientDeleteResponse, ClientDetail, ClientGetCampaigns, ClientGetCampaignsResponse, ClientGetDetail, ClientGetDetailResponse, ClientGetLists, ClientGetListsResponse, ClientGetSegments, ClientGetSegmentsResponse, ClientGetSuppressionList, ClientGetSuppressionListResponse, ClientGetTemplates, ClientGetTemplatesResponse, ClientUpdateAccessAndBilling, ClientUpdateAccessAndBillingResponse, ClientUpdateBasics, ClientUpdateBasicsResponse, List, ListCreate, ListCreateCustomField, ListCreateCustomFieldResponse, ListCreateResponse, ListCustomField, ListDelete, ListDeleteCustomField, ListDeleteCustomFieldResponse, ListDeleteResponse, ListDetail, ListGetCustomFields, ListGetCustomFieldsResponse, ListGetDetail, ListGetDetailResponse, ListGetStats, ListGetStatsResponse, ListStatistics, ListUpdate, ListUpdateResponse, Result, Subscriber, SubscriberAdd, SubscriberAddAndResubscribe, SubscriberAddAndResubscribeResponse, SubscriberAddAndResubscribeWithCustomFields, SubscriberAddAndResubscribeWithCustomFieldsResponse, SubscriberAddResponse, SubscriberAddWithCustomFields, SubscriberAddWithCustomFieldsResponse, SubscriberBounce, SubscriberClick, SubscriberClickedLink, SubscriberCustomField, SubscriberFieldDataType, SubscriberOpen, SubscriberUnsubscribe, SubscriberUnsubscribeResponse, SubscriberUnsubscribe_, SubscribersGetActive, SubscribersGetActiveResponse, SubscribersGetBounced, SubscribersGetBouncedResponse, SubscribersGetIsSubscribed, SubscribersGetIsSubscribedResponse, SubscribersGetSingleSubscriber, SubscribersGetSingleSubscriberResponse, SubscribersGetUnsubscribed, SubscribersGetUnsubscribedResponse, Template, TemplateCreate, TemplateCreateResponse, TemplateDelete, TemplateDeleteResponse, TemplateGetDetail, TemplateGetDetailResponse, TemplateUpdate, TemplateUpdateResponse, UserGetApiKey, UserGetApiKeyResponse, UserGetClients, UserGetClientsResponse, UserGetCountries, UserGetCountriesResponse, UserGetSystemDate, UserGetSystemDateResponse, UserGetTimezones, UserGetTimezonesResponse

Class Method Summary collapse

Methods included from ModuleMixin

#handle_response, included

Class Method Details

.countries(opts = {}) ⇒ Object

This method returns an Array of Strings representing all the available countries.

Aviable opts arguments are:

* :apiKey - optional API key to use to make request. Will use CAMPAIGN_MONITOR_API_KEY if not set.


38
39
40
41
# File 'lib/campaigning/campaigning.rb', line 38

def self.countries(opts={})
  response = @@soap.getCountries(:apiKey => opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY)
  dateTime = handle_response response.user_GetCountriesResult
end

.set_debug_mode(option) ⇒ Object

This method turns the API debug mode to :on and :off, which will display at the console all SOAP requests made to the API server.



46
47
48
# File 'lib/campaigning/campaigning.rb', line 46

def self.set_debug_mode(option)
  option == :on ? @@soap.wiredump_dev = STDERR : @@soap.wiredump_dev = false
end

.set_endpoint_url(endpoint_url) ⇒ Object



50
51
52
# File 'lib/campaigning/campaigning.rb', line 50

def self.set_endpoint_url(endpoint_url)
  @@soap = Campaigning::ApiSoap.new(endpoint_url)
end

.system_date(opts = {}) ⇒ Object

Gets the server system time for your time zone. This is handy for when you are syncing your Campaign Monitor lists with some other in-house list, allowing you accurately determine the time on our server when you carry out the synchronization.

Aviable opts arguments are:

* :apiKey - optional API key to use to make request. Will use CAMPAIGN_MONITOR_API_KEY if not set.


19
20
21
22
# File 'lib/campaigning/campaigning.rb', line 19

def self.system_date(opts={})
  response = @@soap.getSystemDate(:apiKey => opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY)
  dateTime = handle_response response.user_GetSystemDateResult
end

.timezones(opts = {}) ⇒ Object

This method returns an Array of Strings representing all the available timezones.

Aviable opts arguments are:

* :apiKey - optional API key to use to make request. Will use CAMPAIGN_MONITOR_API_KEY if not set.


29
30
31
# File 'lib/campaigning/campaigning.rb', line 29

def self.timezones(opts={})
  handle_response @@soap.getTimezones(:apiKey => opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY).user_GetTimezonesResult
end