loops_sdk 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8a4baf2050d5fbaeeb96e5c39000b77fb84603d539218df1b001763d265aeab
4
- data.tar.gz: 707d8a389ae61d4f8c3c0621a6ec4edb4b0d1c822084e2b680b41ecf7f6d6375
3
+ metadata.gz: 38e9951d94773ecbe15f45265e8a9f165db7515791ac01e420563ed863a26f50
4
+ data.tar.gz: 41128ec37890abc5f7e61a5ae8c5ec9feb7d28782bff9f46eb654d996ba11f60
5
5
  SHA512:
6
- metadata.gz: f0b31acb878a70e3665a081e26db46e61cd32cf4d4d032560547122f12c74ef5d0fd03824d481b981f836d9d2aa9ba4ccc279b3131a2dfab01dad3e148fa4c6a
7
- data.tar.gz: 8c7575f7b5882b62bf7d627c36be1ac801f5f31b973c5e72a787c6b61247e5766219642dcc75eab860fbcba4ad9f0e9925e4479d1927c8b58c2d881e96515493
6
+ metadata.gz: 4a4a15c19cee615df6b1f3cecdfc94d1c0528c68822048a1b908f61bdec682c158c578daaab99f25fa79e156662d9f66072dfaabab8d44a9a778ea2f428159d0
7
+ data.tar.gz: 108fee098145bf52e79b3e6dd55d46618044c61f6aa3a4f6865e80529f1914e54c7fdef8a27b932d81808a1027ac3b8c08ac9b64e067902e01874bd8a047da7d
data/README.md CHANGED
@@ -167,6 +167,7 @@ You can use custom contact properties in API calls. Please make sure to [add cus
167
167
  - [EmailMessages.get()](#emailmessagesget)
168
168
  - [EmailMessages.update()](#emailmessagesupdate)
169
169
  - [EmailMessages.preview()](#emailmessagespreview)
170
+ - [EmailMessages.render()](#emailmessagesrender)
170
171
  - [EmailMessages.run_guardian()](#emailmessagesrun_guardian)
171
172
  - [TransactionalGroups.list()](#transactionalgroupslist)
172
173
  - [TransactionalGroups.create()](#transactionalgroupscreate)
@@ -780,10 +781,11 @@ List transactional emails, most recently created first.
780
781
 
781
782
  #### Parameters
782
783
 
783
- | Name | Type | Required | Notes |
784
- | --------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
785
- | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
786
- | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
784
+ | Name | Type | Required | Notes |
785
+ | -------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
786
+ | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
787
+ | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
788
+ | `transactional_group_id` | string | No | Only return transactional emails in this transactional group. An ID that matches no group returns an empty list. |
787
789
 
788
790
  #### Example
789
791
 
@@ -791,6 +793,8 @@ List transactional emails, most recently created first.
791
793
  response = LoopsSdk::Transactional.list
792
794
 
793
795
  response = LoopsSdk::Transactional.list(perPage: 15, cursor: "cursor_value")
796
+
797
+ response = LoopsSdk::Transactional.list(transactional_group_id: "clg7n5p3q1r9s7t5u3v1w9y7")
794
798
  ```
795
799
 
796
800
  #### Response
@@ -1473,15 +1477,18 @@ List campaigns.
1473
1477
 
1474
1478
  #### Parameters
1475
1479
 
1476
- | Name | Type | Required | Notes |
1477
- | --------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
1478
- | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
1479
- | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
1480
+ | Name | Type | Required | Notes |
1481
+ | -------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
1482
+ | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
1483
+ | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
1484
+ | `campaign_group_id` | string | No | Only return campaigns in this campaign group. An ID that matches no group returns an empty list. |
1480
1485
 
1481
1486
  #### Example
1482
1487
 
1483
1488
  ```ruby
1484
1489
  response = LoopsSdk::Campaigns.list
1490
+
1491
+ response = LoopsSdk::Campaigns.list(campaign_group_id: "cln4o7p9q0110msw5ekjtmv78")
1485
1492
  ```
1486
1493
 
1487
1494
  #### Response
@@ -1821,6 +1828,40 @@ response = LoopsSdk::EmailMessages.preview(
1821
1828
 
1822
1829
  ---
1823
1830
 
1831
+ ### EmailMessages.render()
1832
+
1833
+ Render an email message as HTML without sending it. The HTML matches a preview email body. Accepted variable fields depend on the parent type.
1834
+
1835
+ [API Reference](https://loops.so/docs/api-reference/render-email-message)
1836
+
1837
+ #### Parameters
1838
+
1839
+ | Name | Type | Required | Notes |
1840
+ | -------------------- | ------ | -------- | ------------------------------------------------------------------------------- |
1841
+ | `email_message_id` | string | Yes | The ID of the email message. |
1842
+ | `contact_properties` | object | No | Contact property values to render. Accepted for campaign and workflow emails. |
1843
+ | `event_properties` | object | No | Event property values to render. Accepted for workflow emails only. |
1844
+ | `data_variables` | object | No | Transactional data variables to render. Accepted for transactional emails only. |
1845
+
1846
+ #### Example
1847
+
1848
+ ```ruby
1849
+ response = LoopsSdk::EmailMessages.render(
1850
+ email_message_id: "cly8k3m0n0044jpx2bghepq45",
1851
+ contact_properties: { firstName: "Alex" }
1852
+ )
1853
+ ```
1854
+
1855
+ #### Response
1856
+
1857
+ ```json
1858
+ {
1859
+ "html": "<html><body>Hello, Alex!</body></html>"
1860
+ }
1861
+ ```
1862
+
1863
+ ---
1864
+
1824
1865
  ### EmailMessages.run_guardian()
1825
1866
 
1826
1867
  Run Guardian content validation on an email message and return errors and warnings.
@@ -2300,15 +2341,18 @@ List workflows.
2300
2341
 
2301
2342
  #### Parameters
2302
2343
 
2303
- | Name | Type | Required | Notes |
2304
- | --------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
2305
- | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
2306
- | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
2344
+ | Name | Type | Required | Notes |
2345
+ | -------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
2346
+ | `perPage` | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
2347
+ | `cursor` | string | No | A cursor, to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response. |
2348
+ | `workflow_group_id` | string | No | Only return workflows in this workflow group. An ID that matches no group returns an empty list. |
2307
2349
 
2308
2350
  #### Example
2309
2351
 
2310
2352
  ```ruby
2311
2353
  response = LoopsSdk::Workflows.list
2354
+
2355
+ response = LoopsSdk::Workflows.list(workflow_group_id: "clw8x0y2z0300ycc1lrstvw78")
2312
2356
  ```
2313
2357
 
2314
2358
  #### Response
@@ -3,8 +3,10 @@
3
3
  module LoopsSdk
4
4
  class Campaigns < Base
5
5
  class << self
6
- def list(perPage: 20, cursor: nil)
7
- make_request(method: :get, path: "v1/campaigns", params: { perPage: perPage, cursor: cursor })
6
+ def list(perPage: 20, cursor: nil, campaign_group_id: nil)
7
+ params = { perPage: perPage, cursor: cursor }
8
+ params[:campaignGroupId] = campaign_group_id if campaign_group_id
9
+ make_request(method: :get, path: "v1/campaigns", params: params)
8
10
  end
9
11
 
10
12
  def create(name:, campaign_group_id: nil, mailing_list_id: nil, audience_segment_id: nil, audience_filter: nil, scheduling: nil)
@@ -53,6 +53,15 @@ module LoopsSdk
53
53
  make_request(method: :post, path: "v1/email-messages/#{email_message_id}/preview", body: body)
54
54
  end
55
55
 
56
+ def render(email_message_id:, contact_properties: nil, event_properties: nil, data_variables: nil)
57
+ body = {
58
+ contactProperties: contact_properties,
59
+ eventProperties: event_properties,
60
+ dataVariables: data_variables
61
+ }.compact
62
+ make_request(method: :post, path: "v1/email-messages/#{email_message_id}/render", body: body)
63
+ end
64
+
56
65
  def run_guardian(email_message_id:)
57
66
  make_request(method: :get, path: "v1/email-messages/#{email_message_id}/guardian")
58
67
  end
@@ -3,8 +3,10 @@
3
3
  module LoopsSdk
4
4
  class Transactional < Base
5
5
  class << self
6
- def list(perPage: 20, cursor: nil)
7
- make_request(method: :get, path: "v1/transactional-emails", params: { perPage: perPage, cursor: cursor })
6
+ def list(perPage: 20, cursor: nil, transactional_group_id: nil)
7
+ params = { perPage: perPage, cursor: cursor }
8
+ params[:transactionalGroupId] = transactional_group_id if transactional_group_id
9
+ make_request(method: :get, path: "v1/transactional-emails", params: params)
8
10
  end
9
11
 
10
12
  def create(name:, transactional_group_id: nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LoopsSdk
4
- VERSION = "2.6.0"
4
+ VERSION = "2.7.0"
5
5
  end
@@ -3,8 +3,10 @@
3
3
  module LoopsSdk
4
4
  class Workflows < Base
5
5
  class << self
6
- def list(perPage: 20, cursor: nil)
7
- make_request(method: :get, path: "v1/workflows", params: { perPage: perPage, cursor: cursor })
6
+ def list(perPage: 20, cursor: nil, workflow_group_id: nil)
7
+ params = { perPage: perPage, cursor: cursor }
8
+ params[:workflowGroupId] = workflow_group_id if workflow_group_id
9
+ make_request(method: :get, path: "v1/workflows", params: params)
8
10
  end
9
11
 
10
12
  def create(name:, description: nil, mailing_list_id: nil, workflow_group_id: nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loops_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Rowden
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-05 00:00:00.000000000 Z
11
+ date: 2026-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday