ElasticEmail

 view release on metacpan or  search on metacpan

lib/ElasticEmail.pm  view on Meta::CPAN

            # IEnumerable<string> channelNames - List of channel names used for processing
            # ApiTypes::CompressionFormat compressionFormat - FileResponse compression format. None or Zip. (default ApiTypes.CompressionFormat.EENone)
            # string fileName - Name of your file. (default None)
        # Returns File
    sub ExportJson
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        channelNames => shift,
                        compressionFormat => shift,
                        fileName => shift];
        return $Api::mainApi->Request('channel/exportjson', "GET", \@params);
    }

        # Export channels in XML file format.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # IEnumerable<string> channelNames - List of channel names used for processing
            # ApiTypes::CompressionFormat compressionFormat - FileResponse compression format. None or Zip. (default ApiTypes.CompressionFormat.EENone)
            # string fileName - Name of your file. (default None)
        # Returns File
    sub ExportXml
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        channelNames => shift,
                        compressionFormat => shift,
                        fileName => shift];
        return $Api::mainApi->Request('channel/exportxml', "GET", \@params);
    }

        # List all of your channels
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
        # Returns List<ApiTypes::Channel>
    sub List
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}];
        return $Api::mainApi->Request('channel/list', "GET", \@params);
    }

        # Rename an existing channel.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string name - The name of the channel to update.
            # string newName - The new name for the channel.
        # Returns string
    sub Update
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        name => shift,
                        newName => shift];
        return $Api::mainApi->Request('channel/update', "GET", \@params);
    }


#
# Methods used to manage your Contacts.
#
package Api::Contact;

        # Activate contacts that are currently blocked.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # bool activateAllBlocked - Activate all your blocked contacts.  Passing True will override email list and activate all your blocked contacts. (default False)
            # IEnumerable<string> emails - Comma delimited list of contact emails (default None)
    sub ActivateBlocked
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        activateAllBlocked => shift,
                        emails => shift];
        return $Api::mainApi->Request('contact/activateblocked', "GET", \@params);
    }

        # Add a new contact and optionally to one of your lists.  Note that your API KEY is not required for this call.
            # string publicAccountID - Public key for limited access to your account such as contact/add so you can use it safely on public websites.
            # string email - Proper email address.
            # string[] publicListID - ID code of list (default None)
            # string[] listName - Name of your list. (default None)
            # string title - Title (default None)
            # string firstName - First name. (default None)
            # string lastName - Last name. (default None)
            # string phone - Phone number (default None)
            # string mobileNumber - Mobile phone number (default None)
            # string notes - Free form field of notes (default None)
            # string gender - Your gender (default None)
            # DateTime? birthDate - Date of birth in YYYY-MM-DD format (default None)
            # string city - City. (default None)
            # string state - State or province. (default None)
            # string postalCode - Zip/postal code. (default None)
            # string country - Name of country. (default None)
            # string organizationName - Name of organization (default None)
            # string website - HTTP address of your website. (default None)
            # int? annualRevenue - Annual revenue of contact (default None)
            # string industry - Industry contact works in (default None)
            # int? numberOfEmployees - Number of employees (default None)
            # ApiTypes::ContactSource source - Specifies the way of uploading the contact (default ApiTypes.ContactSource.ContactApi)
            # string returnUrl - URL to navigate to after account creation (default None)
            # string sourceUrl - URL from which request was sent. (default None)
            # string activationReturnUrl - The url to return the contact to after activation. (default None)
            # string activationTemplate -  (default None)
            # bool sendActivation - True, if you want to send activation email to this account. Otherwise, false (default True)
            # DateTime? consentDate - Date of consent to send this contact(s) your email. If not provided current date is used for consent. (default None)
            # string consentIP - IP address of consent to send this contact(s) your email. If not provided your current public IP address is used for consent. (default None)
            # Dictionary<string, string> field - Custom contact field like firstname, lastname, city etc. Request parameters prefixed by field_ like field_firstname, field_lastname  (default None)
            # string notifyEmail - Emails, separated by semicolon, to which the notification about contact subscribing should be sent to (default None)
        # Returns string
    sub Add
    {
        shift;
        my @params = [publicAccountID => shift,
                        email => shift,
                        publicListID => shift,
                        listName => shift,
                        title => shift,
                        firstName => shift,
                        lastName => shift,
                        phone => shift,
                        mobileNumber => shift,
                        notes => shift,
                        gender => shift,
                        birthDate => shift,
                        city => shift,
                        state => shift,
                        postalCode => shift,
                        country => shift,
                        organizationName => shift,
                        website => shift,
                        annualRevenue => shift,
                        industry => shift,
                        numberOfEmployees => shift,
                        source => shift,
                        returnUrl => shift,
                        sourceUrl => shift,
                        activationReturnUrl => shift,
                        activationTemplate => shift,
                        sendActivation => shift,
                        consentDate => shift,
                        consentIP => shift,
                        field => shift,
                        notifyEmail => shift];
        return $Api::mainApi->Request('contact/add', "GET", \@params);
    }

        # Manually add or update a contacts status to Abuse, Bounced or Unsubscribed status (blocked).
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string email - Proper email address.
            # ApiTypes::ContactStatus status - Name of status: Active, Engaged, Inactive, Abuse, Bounced, Unsubscribed.
    sub AddBlocked
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        email => shift,
                        status => shift];
        return $Api::mainApi->Request('contact/addblocked', "GET", \@params);
    }

        # Change any property on the contact record.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string email - Proper email address.
            # string name - Name of the contact property you want to change.
            # string value - Value you would like to change the contact property to.
    sub ChangeProperty
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        email => shift,
                        name => shift,
                        value => shift];
        return $Api::mainApi->Request('contact/changeproperty', "GET", \@params);
    }

        # Changes status of selected Contacts. You may provide RULE for selection or specify list of Contact IDs.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # ApiTypes::ContactStatus status - Name of status: Active, Engaged, Inactive, Abuse, Bounced, Unsubscribed.
            # string rule - Query used for filtering. (default None)
            # IEnumerable<string> emails - Comma delimited list of contact emails (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
    sub ChangeStatus
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        status => shift,
                        rule => shift,
                        emails => shift,
                        allContacts => shift];
        return $Api::mainApi->Request('contact/changestatus', "GET", \@params);
    }

        # Returns number of Contacts, RULE specifies contact Status.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string rule - Query used for filtering. (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
        # Returns ApiTypes::ContactStatusCounts
    sub CountByStatus
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        rule => shift,
                        allContacts => shift];
        return $Api::mainApi->Request('contact/countbystatus', "GET", \@params);
    }

        # Permanantly deletes the contacts provided.  You can provide either a qualified rule or a list of emails (comma separated string).
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string rule - Query used for filtering. (default None)
            # IEnumerable<string> emails - Comma delimited list of contact emails (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
    sub Delete
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        rule => shift,
                        emails => shift,
                        allContacts => shift];

lib/ElasticEmail.pm  view on Meta::CPAN

            # string email - Proper email address.
        # Returns ApiTypes::ContactCollection
    sub FindContact
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        email => shift];
        return $Api::mainApi->Request('contact/findcontact', "GET", \@params);
    }

        # List of Contacts for provided List
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
            # int limit - Maximum of loaded items. (default 20)
            # int offset - How many items should be loaded ahead. (default 0)
        # Returns List<ApiTypes::Contact>
    sub GetContactsByList
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift,
                        limit => shift,
                        offset => shift];
        return $Api::mainApi->Request('contact/getcontactsbylist', "GET", \@params);
    }

        # List of Contacts for provided Segment
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string segmentName - Name of your segment.
            # int limit - Maximum of loaded items. (default 20)
            # int offset - How many items should be loaded ahead. (default 0)
        # Returns List<ApiTypes::Contact>
    sub GetContactsBySegment
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        segmentName => shift,
                        limit => shift,
                        offset => shift];
        return $Api::mainApi->Request('contact/getcontactsbysegment', "GET", \@params);
    }

        # List of all contacts. If you have not specified RULE, all Contacts will be listed.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string rule - Query used for filtering. (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
            # int limit - Maximum of loaded items. (default 20)
            # int offset - How many items should be loaded ahead. (default 0)
        # Returns List<ApiTypes::Contact>
    sub List
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        rule => shift,
                        allContacts => shift,
                        limit => shift,
                        offset => shift];
        return $Api::mainApi->Request('contact/list', "GET", \@params);
    }

        # Load blocked contacts
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # IEnumerable<ApiTypes::ContactStatus> statuses - List of comma separated message statuses: 0 or all, 1 for ReadyToSend, 2 for InProgress, 4 for Bounced, 5 for Sent, 6 for Opened, 7 for Clicked, 8 for Unsubscribed, 9 for Abuse Report
            # string search - List of blocked statuses: Abuse, Bounced or Unsubscribed (default None)
            # int limit - Maximum of loaded items. (default 0)
            # int offset - How many items should be loaded ahead. (default 0)
        # Returns List<ApiTypes::BlockedContact>
    sub LoadBlocked
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        statuses => shift,
                        search => shift,
                        limit => shift,
                        offset => shift];
        return $Api::mainApi->Request('contact/loadblocked', "GET", \@params);
    }

        # Load detailed contact information
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string email - Proper email address.
        # Returns ApiTypes::Contact
    sub LoadContact
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        email => shift];
        return $Api::mainApi->Request('contact/loadcontact', "GET", \@params);
    }

        # Shows detailed history of chosen Contact.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string email - Proper email address.
            # int limit - Maximum of loaded items. (default 0)
            # int offset - How many items should be loaded ahead. (default 0)
        # Returns List<ApiTypes::ContactHistory>
    sub LoadHistory
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        email => shift,
                        limit => shift,
                        offset => shift];
        return $Api::mainApi->Request('contact/loadhistory', "GET", \@params);
    }

        # Add new Contact to one of your Lists.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # IEnumerable<string> emails - Comma delimited list of contact emails
            # string firstName - First name. (default None)
            # string lastName - Last name. (default None)
            # string title - Title (default None)
            # string organization - Name of organization (default None)
            # string industry - Industry contact works in (default None)
            # string city - City. (default None)
            # string country - Name of country. (default None)
            # string state - State or province. (default None)
            # string zip - Zip/postal code. (default None)
            # string publicListID - ID code of list (default None)
            # string listName - Name of your list. (default None)
            # ApiTypes::ContactStatus status - Name of status: Active, Engaged, Inactive, Abuse, Bounced, Unsubscribed. (default ApiTypes.ContactStatus.Active)
            # string notes - Free form field of notes (default None)
            # DateTime? consentDate - Date of consent to send this contact(s) your email. If not provided current date is used for consent. (default None)
            # string consentIP - IP address of consent to send this contact(s) your email. If not provided your current public IP address is used for consent. (default None)
            # string notifyEmail - Emails, separated by semicolon, to which the notification about contact subscribing should be sent to (default None)
    sub QuickAdd
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        emails => shift,
                        firstName => shift,
                        lastName => shift,
                        title => shift,
                        organization => shift,
                        industry => shift,
                        city => shift,

lib/ElasticEmail.pm  view on Meta::CPAN

        return $Api::mainApi->Request('list/add', "GET", \@params);
    }

        # Add Contacts to chosen list
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
            # string rule - Query used for filtering. (default None)
            # IEnumerable<string> emails - Comma delimited list of contact emails (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
    sub AddContacts
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift,
                        rule => shift,
                        emails => shift,
                        allContacts => shift];
        return $Api::mainApi->Request('list/addcontacts', "GET", \@params);
    }

        # Copy your existing List with the option to provide new settings to it. Some fields, when left empty, default to the source list's settings
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string sourceListName - The name of the list you want to copy
            # string newlistName - Name of your list if you want to change it. (default None)
            # bool? createEmptyList - True to create an empty list, otherwise false. Ignores rule and emails parameters if provided. (default None)
            # bool? allowUnsubscribe - True: Allow unsubscribing from this list. Otherwise, false (default None)
            # string rule - Query used for filtering. (default None)
        # Returns int
    sub Copy
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        sourceListName => shift,
                        newlistName => shift,
                        createEmptyList => shift,
                        allowUnsubscribe => shift,
                        rule => shift];
        return $Api::mainApi->Request('list/copy', "GET", \@params);
    }

        # Create a new list from the recipients of the given campaign, using the given statuses of Messages
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # int campaignID - ID of the campaign which recipients you want to copy
            # string listName - Name of your list.
            # IEnumerable<ApiTypes::LogJobStatus> statuses - Statuses of a campaign's emails you want to include in the new list (but NOT the contacts' statuses) (default None)
        # Returns int
    sub CreateFromCampaign
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        campaignID => shift,
                        listName => shift,
                        statuses => shift];
        return $Api::mainApi->Request('list/createfromcampaign', "GET", \@params);
    }

        # Create a series of nth selection lists from an existing list or segment
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
            # int numberOfLists - The number of evenly distributed lists to create.
            # bool excludeBlocked - True if you want to exclude contacts that are currently in a blocked status of either unsubscribe, complaint or bounce. Otherwise, false. (default True)
            # bool allowUnsubscribe - True: Allow unsubscribing from this list. Otherwise, false (default False)
            # string rule - Query used for filtering. (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
    sub CreateNthSelectionLists
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift,
                        numberOfLists => shift,
                        excludeBlocked => shift,
                        allowUnsubscribe => shift,
                        rule => shift,
                        allContacts => shift];
        return $Api::mainApi->Request('list/createnthselectionlists', "GET", \@params);
    }

        # Create a new list with randomized contacts from an existing list or segment
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
            # int count - Number of items.
            # bool excludeBlocked - True if you want to exclude contacts that are currently in a blocked status of either unsubscribe, complaint or bounce. Otherwise, false. (default True)
            # bool allowUnsubscribe - True: Allow unsubscribing from this list. Otherwise, false (default False)
            # string rule - Query used for filtering. (default None)
            # bool allContacts - True: Include every Contact in your Account. Otherwise, false (default False)
        # Returns int
    sub CreateRandomList
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift,
                        count => shift,
                        excludeBlocked => shift,
                        allowUnsubscribe => shift,
                        rule => shift,
                        allContacts => shift];
        return $Api::mainApi->Request('list/createrandomlist', "GET", \@params);
    }

        # Deletes List and removes all the Contacts from it (does not delete Contacts).
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
    sub Delete
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift];
        return $Api::mainApi->Request('list/delete', "GET", \@params);
    }

        # Exports all the contacts from the provided list
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
            # ApiTypes::ExportFileFormats fileFormat -  (default ApiTypes.ExportFileFormats.Csv)
            # ApiTypes::CompressionFormat compressionFormat - FileResponse compression format. None or Zip. (default ApiTypes.CompressionFormat.EENone)
            # string fileName - Name of your file. (default None)
        # Returns ApiTypes::ExportLink
    sub Export
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift,
                        fileFormat => shift,
                        compressionFormat => shift,
                        fileName => shift];
        return $Api::mainApi->Request('list/export', "GET", \@params);
    }

        # Shows all your existing lists
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # DateTime? from - Starting date for search in YYYY-MM-DDThh:mm:ss format. (default None)
            # DateTime? to - Ending date for search in YYYY-MM-DDThh:mm:ss format. (default None)
        # Returns List<ApiTypes::List>
    sub list
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        from => shift,
                        to => shift];
        return $Api::mainApi->Request('list/list', "GET", \@params);
    }

        # Returns detailed information about specific list.
            # string apikey - ApiKey that gives you access to our SMTP and HTTP API's.
            # string listName - Name of your list.
        # Returns ApiTypes::List
    sub Load
    {
        shift;
        my @params = [apikey => $Api::mainApi->{apikey}, 
                        listName => shift];
        return $Api::mainApi->Request('list/load', "GET", \@params);
    }

lib/ElasticEmail.pm  view on Meta::CPAN


        #
        # True, if you have enabled link tracking. Otherwise, false
        #
        LinkTracking => shift,

        #
        # Type of content encoding
        #
        ContentTransferEncoding => shift,

        #
        # Amount of Litmus credits
        #
        LitmusCredits => shift,

        #
        # Enable advanced tools on your Account.
        #
        EnableContactFeatures => shift,

        #
        # 
        #
        NeedsSMSVerification => shift,

        };
        bless $self, $class;
        return $self;
    }

    # 
    # Basic overview of your account
    # 
    package ApiTypes::AccountOverview;
    sub new
    {
        my $class = shift;
        my $self = {
        #
        # Amount of emails sent from this account
        #
        TotalEmailsSent => shift,

        #
        # Amount of emails sent from this account
        #
        Credit => shift,

        #
        # Cost of 1000 emails
        #
        CostPerThousand => shift,

        #
        # Number of messages in progress
        #
        InProgressCount => shift,

        #
        # Number of contacts currently with blocked status of Unsubscribed, Complaint, Bounced or InActive
        #
        BlockedContactsCount => shift,

        #
        # Numeric reputation
        #
        Reputation => shift,

        #
        # Number of contacts
        #
        ContactCount => shift,

        #
        # Number of created campaigns
        #
        CampaignCount => shift,

        #
        # Number of available templates
        #
        TemplateCount => shift,

        #
        # Number of created subaccounts
        #
        SubAccountCount => shift,

        #
        # Number of active referrals
        #
        ReferralCount => shift,

        };
        bless $self, $class;
        return $self;
    }

    # 
    # Lists advanced sending options of your account.
    # 
    package ApiTypes::AdvancedOptions;
    sub new
    {
        my $class = shift;
        my $self = {
        #
        # True, if you want to track clicks. Otherwise, false
        #
        EnableClickTracking => shift,

        #
        # True, if you want to track by link tracking. Otherwise, false
        #
        EnableLinkClickTracking => shift,

        #
        # True, if you want to use template scripting in your emails {{}}. Otherwise, false
        #
        EnableTemplateScripting => shift,

        #

lib/ElasticEmail.pm  view on Meta::CPAN

        # (0 means this functionality is NOT enabled) Number of days of inactivity for a contact after which the given recipient should be moved to the Stale status
        #
        StaleContactInactiveDays => shift,

        };
        bless $self, $class;
        return $self;
    }

    # 
    # 
    # 
    package ApiTypes::APIKeyAction;
    use constant {
        #
        # Add an additional APIKey to your Account.
        #
        ADD => '1',

        #
        # Change this APIKey to a new one.
        #
        CHANGE => '2',

        #
        # Delete this APIKey
        #
        DELETE => '3',

    };

    # 
    # Attachment data
    # 
    package ApiTypes::Attachment;
    sub new
    {
        my $class = shift;
        my $self = {
        #
        # Name of your file.
        #
        FileName => shift,

        #
        # ID number of your attachment
        #
        ID => shift,

        #
        # Size of your attachment.
        #
        Size => shift,

        };
        bless $self, $class;
        return $self;
    }

    # 
    # Blocked Contact - Contact returning Hard Bounces
    # 
    package ApiTypes::BlockedContact;
    sub new
    {
        my $class = shift;
        my $self = {
        #
        # Proper email address.
        #
        Email => shift,

        #
        # Name of status: Active, Engaged, Inactive, Abuse, Bounced, Unsubscribed.
        #
        Status => shift,

        #
        # RFC error message
        #
        FriendlyErrorMessage => shift,

        #
        # Last change date
        #
        DateUpdated => shift,

        };
        bless $self, $class;
        return $self;
    }

    # 
    # Summary of bounced categories, based on specified date range.
    # 
    package ApiTypes::BouncedCategorySummary;
    sub new
    {
        my $class = shift;
        my $self = {
        #
        # Number of messages marked as SPAM
        #
        Spam => shift,

        #
        # Number of blacklisted messages
        #
        BlackListed => shift,

        #
        # Number of messages flagged with 'No Mailbox'
        #
        NoMailbox => shift,

        #
        # Number of messages flagged with 'Grey Listed'
        #
        GreyListed => shift,

        #
        # Number of messages flagged with 'Throttled'
        #



( run in 0.684 second using v1.01-cache-2.11-cpan-437f7b0c052 )