Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EmailListSubscriptions

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private Readonly store

store: Store

Static Readonly DEFAULT_FIELDS

DEFAULT_FIELDS: string = ...

Methods

add

  • Add a subscriber to a list with a new person:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.marketing.emailListSubscriptions.add({
      EmailList: {
        Uid: 'ngWKYnQp'
      },
      Person: {
        Email: 'hello@tiltcamp.com'
      }
    });
    console.log(response);
    

    Add a subscriber to a list with an existing person:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.marketing.emailListSubscriptions.add({
      EmailList: {
        Uid: 'ngWKYnQp'
      },
      Person: {
        Uid: 'DQ2DyknW'
      }
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" or non-"400" status, the whole response object will be thrown.

    Parameters

    • subscription: SubscriptionAdd

      The subscription to add.

    • options: { fields?: string } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

    Returns Promise<null | ValidationError<Person>>

    Null if response status OK, or response body of validation errors if response status 400.

delete

  • Remove a specific subscriber from an email list.

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.marketing.emailListSubscriptions.delete({
      EmailList: {
        Uid: 'ngWKYnQp'
      },
      Person: {
        Uid: 'wQXrBxWK'
      }
    });
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    Returns Promise<null>

    Null if deletion was successful.

getAll

  • getAll(listUid: string, options?: { fields?: string; limit?: number; offset?: number }): Promise<List<EmailListPerson>>
  • Get all subscriptions to a list:

    const client = new OutsetaApiClient({
      subdomain: 'test-company',
      apiKey: example_key,
      secretKey: example_secret
    });
    const response = await client.marketing.emailListSubscriptions.getAll(listUid);
    console.log(response);
    
    throws

    Response If the server returns a non-"OK" status, the whole response object will be thrown.

    Parameters

    • listUid: string
    • options: { fields?: string; limit?: number; offset?: number } = {}
      • Optional fields?: string

        Not all fields on the model are returned by default - you can request specific fields with a that looks something like ',(field name here).(child field name here or * for all)'. Note: the shape of the returned object may not match the model in this library if this string does not start with '' as shown.

      • Optional limit?: number

        The number of results returned by the API.

      • Optional offset?: number

        For pagination; returns (limit) results after this value.

    Returns Promise<List<EmailListPerson>>

    The response body if response status OK.

Generated using TypeDoc