smartletter 1.2.0 → 1.3.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.
package/README.md CHANGED
@@ -99,6 +99,16 @@ const event = smartletter.webhooks.verify({
99
99
 
100
100
  ## Changelog
101
101
 
102
+ ### 1.3.0
103
+
104
+ New fields only, nothing renamed or removed.
105
+
106
+ - `newsletters.create` and `newsletters.update` take `kind` and `from`. `kind: "newsletter"` (the default) goes to the subscribers of the newsletter or of a topic. `kind: "broadcast"` goes to the contacts of the group, subscribed or not, takes no `topicId` and never shows in the archive. `from` is the sender address of this issue, on the newsletter's custom domain (`name@your-domain.com`, or just `name`). Every newsletter returned has `kind` and `from`.
107
+ - `newsletters.update` accepts `topicId: null` for a broadcast.
108
+ - `contacts.create`, `contacts.update` and `contacts.import` take `newsletterSubscribed`. `false` adds the contact to the group only: they get broadcasts, not newsletter issues. A new contact defaults to `true`. An existing contact changes only with an explicit `true` (`contacts.update` also takes `false`). Every contact returned has `newsletter_subscribed`.
109
+ - Sending needs a verified domain of your own. Without one, the API answers `403 domain_required_to_send`; a young domain still in review answers `403 domain_under_review`. `pause_reason` may be `domain_required`, and domains return `review_status`.
110
+ - `threads.reply` and `messages.send` always return `id`, also when the message is queued before its row exists.
111
+
102
112
  ### 1.2.0
103
113
 
104
114
  **Breaking changes.** Two fields of the API's answers are renamed to snake_case, like every other field. There is no alias: the old name is gone.
package/dist/index.cjs CHANGED
@@ -81,7 +81,7 @@ var Client = class {
81
81
  }
82
82
  this.key = resolved;
83
83
  this.baseUrl = (options.baseUrl || env("SMARTLETTER_BASE_URL") || DEFAULT_BASE_URL).replace(/\/+$/, "");
84
- this.userAgent = options.userAgent ?? `smartletter-node/${"1.2.0"}`;
84
+ this.userAgent = options.userAgent ?? `smartletter-node/${"1.3.0"}`;
85
85
  }
86
86
  async call(op, args, options = {}) {
87
87
  const headers = new Headers(options.headers);
@@ -679,6 +679,12 @@ var OPERATIONS = {
679
679
  wire: "winner_mode"
680
680
  }
681
681
  }
682
+ },
683
+ kind: {
684
+ wire: "kind"
685
+ },
686
+ from: {
687
+ wire: "from"
682
688
  }
683
689
  }
684
690
  },
@@ -793,6 +799,12 @@ var OPERATIONS = {
793
799
  wire: "winner_mode"
794
800
  }
795
801
  }
802
+ },
803
+ kind: {
804
+ wire: "kind"
805
+ },
806
+ from: {
807
+ wire: "from"
796
808
  }
797
809
  }
798
810
  },
@@ -977,6 +989,9 @@ var OPERATIONS = {
977
989
  },
978
990
  tags: {
979
991
  wire: "tags"
992
+ },
993
+ newsletterSubscribed: {
994
+ wire: "newsletter_subscribed"
980
995
  }
981
996
  }
982
997
  },
@@ -1027,6 +1042,9 @@ var OPERATIONS = {
1027
1042
  tags: {
1028
1043
  wire: "tags"
1029
1044
  },
1045
+ newsletterSubscribed: {
1046
+ wire: "newsletter_subscribed"
1047
+ },
1030
1048
  status: {
1031
1049
  wire: "status"
1032
1050
  },
@@ -1117,6 +1135,9 @@ var OPERATIONS = {
1117
1135
  },
1118
1136
  removeTags: {
1119
1137
  wire: "remove_tags"
1138
+ },
1139
+ newsletterSubscribed: {
1140
+ wire: "newsletter_subscribed"
1120
1141
  }
1121
1142
  }
1122
1143
  },