Skip to content

Commit 303e34d

Browse files
Merge pull request #24 from sendinblue/feature_updated_swagger_sync
Swagger updates for additional parameters in email campaigns
2 parents b58d91f + cd69f8a commit 303e34d

11 files changed

+72
-21
lines changed

docs/CreateEmailCampaign.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Name | Type | Description | Notes
66
**tag** | **String** | Tag of the campaign | [optional]
77
**sender** | [**CreateEmailCampaignSender**](CreateEmailCampaignSender.md) | |
88
**name** | **String** | Name of the campaign |
9-
**html_content** | **String** | Mandatory if htmlUrl is empty. Body of the message (HTML) | [optional]
10-
**html_url** | **String** | Mandatory if htmlContent is empty. Url to the message (HTML) | [optional]
9+
**html_content** | **String** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional]
10+
**html_url** | **String** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional]
11+
**template_id** | **Integer** | Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional]
1112
**scheduled_at** | **DateTime** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
1213
**subject** | **String** | Subject of the campaign |
1314
**reply_to** | **String** | Email on which the campaign recipients will be able to reply to | [optional]
14-
**to_field** | **String** | To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, use {FNAME} {LNAME}. These attributes must already exist in your contact database | [optional]
15+
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
1516
**recipients** | [**CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional]
1617
**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1718
**inline_image_activation** | **BOOLEAN** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional] [default to false]
@@ -21,5 +22,6 @@ Name | Type | Description | Notes
2122
**footer** | **String** | Footer of the email campaign | [optional]
2223
**header** | **String** | Header of the email campaign | [optional]
2324
**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
25+
**params** | **Object** | Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic' | [optional]
2426

2527

docs/CreateSmtpTemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
1010
**html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional]
1111
**subject** | **String** | Subject of the template |
1212
**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional]
13-
**to_field** | **String** | This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account | [optional]
13+
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
1414
**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1515
**is_active** | **BOOLEAN** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [optional]
1616

docs/UpdateEmailCampaign.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
1111
**scheduled_at** | **DateTime** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
1212
**subject** | **String** | Subject of the campaign | [optional]
1313
**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional]
14-
**to_field** | **String** | This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account | [optional]
14+
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
1515
**recipients** | [**UpdateEmailCampaignRecipients**](UpdateEmailCampaignRecipients.md) | | [optional]
1616
**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1717
**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. | [optional] [default to false]
@@ -20,5 +20,6 @@ Name | Type | Description | Notes
2020
**footer** | **String** | Footer of the email campaign | [optional]
2121
**header** | **String** | Header of the email campaign | [optional]
2222
**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
23+
**params** | **Object** | Pass the set of attributes to customize the type 'classic' campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. | [optional]
2324

2425

docs/UpdateSmtpTemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
1010
**html_url** | **String** | Required if htmlContent is empty. URL to the body of the email (HTML) | [optional]
1111
**subject** | **String** | Subject of the email | [optional]
1212
**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional]
13-
**to_field** | **String** | To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These attributes must already exist in contacts database | [optional]
13+
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
1414
**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1515
**is_active** | **BOOLEAN** | Status of the template. isActive = false means template is inactive, isActive = true means template is active | [optional]
1616

lib/sib-api-v3-sdk/models/create_email_campaign.rb

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ class CreateEmailCampaign
2323
# Name of the campaign
2424
attr_accessor :name
2525

26-
# Mandatory if htmlUrl is empty. Body of the message (HTML)
26+
# Mandatory if htmlUrl and templateId are empty. Body of the message (HTML)
2727
attr_accessor :html_content
2828

29-
# Mandatory if htmlContent is empty. Url to the message (HTML)
29+
# Mandatory if htmlContent and templateId are empty. Url to the message (HTML)
3030
attr_accessor :html_url
3131

32+
# Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
33+
attr_accessor :template_id
34+
3235
# Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
3336
attr_accessor :scheduled_at
3437

@@ -38,7 +41,7 @@ class CreateEmailCampaign
3841
# Email on which the campaign recipients will be able to reply to
3942
attr_accessor :reply_to
4043

41-
# To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, use {FNAME} {LNAME}. These attributes must already exist in your contact database
44+
# To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
4245
attr_accessor :to_field
4346

4447
attr_accessor :recipients
@@ -67,6 +70,9 @@ class CreateEmailCampaign
6770
# Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
6871
attr_accessor :utm_campaign
6972

73+
# Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic'
74+
attr_accessor :params
75+
7076
class EnumAttributeValidator
7177
attr_reader :datatype
7278
attr_reader :allowable_values
@@ -97,6 +103,7 @@ def self.attribute_map
97103
:'name' => :'name',
98104
:'html_content' => :'htmlContent',
99105
:'html_url' => :'htmlUrl',
106+
:'template_id' => :'templateId',
100107
:'scheduled_at' => :'scheduledAt',
101108
:'subject' => :'subject',
102109
:'reply_to' => :'replyTo',
@@ -109,7 +116,8 @@ def self.attribute_map
109116
:'type' => :'type',
110117
:'footer' => :'footer',
111118
:'header' => :'header',
112-
:'utm_campaign' => :'utmCampaign'
119+
:'utm_campaign' => :'utmCampaign',
120+
:'params' => :'params'
113121
}
114122
end
115123

@@ -121,6 +129,7 @@ def self.swagger_types
121129
:'name' => :'String',
122130
:'html_content' => :'String',
123131
:'html_url' => :'String',
132+
:'template_id' => :'Integer',
124133
:'scheduled_at' => :'DateTime',
125134
:'subject' => :'String',
126135
:'reply_to' => :'String',
@@ -133,7 +142,8 @@ def self.swagger_types
133142
:'type' => :'String',
134143
:'footer' => :'String',
135144
:'header' => :'String',
136-
:'utm_campaign' => :'String'
145+
:'utm_campaign' => :'String',
146+
:'params' => :'Object'
137147
}
138148
end
139149

@@ -165,6 +175,10 @@ def initialize(attributes = {})
165175
self.html_url = attributes[:'htmlUrl']
166176
end
167177

178+
if attributes.has_key?(:'templateId')
179+
self.template_id = attributes[:'templateId']
180+
end
181+
168182
if attributes.has_key?(:'scheduledAt')
169183
self.scheduled_at = attributes[:'scheduledAt']
170184
end
@@ -221,6 +235,10 @@ def initialize(attributes = {})
221235
self.utm_campaign = attributes[:'utmCampaign']
222236
end
223237

238+
if attributes.has_key?(:'params')
239+
self.params = attributes[:'params']
240+
end
241+
224242
end
225243

226244
# Show invalid properties with the reasons. Usually used together with valid?
@@ -278,6 +296,7 @@ def ==(o)
278296
name == o.name &&
279297
html_content == o.html_content &&
280298
html_url == o.html_url &&
299+
template_id == o.template_id &&
281300
scheduled_at == o.scheduled_at &&
282301
subject == o.subject &&
283302
reply_to == o.reply_to &&
@@ -290,7 +309,8 @@ def ==(o)
290309
type == o.type &&
291310
footer == o.footer &&
292311
header == o.header &&
293-
utm_campaign == o.utm_campaign
312+
utm_campaign == o.utm_campaign &&
313+
params == o.params
294314
end
295315

296316
# @see the `==` method
@@ -302,7 +322,7 @@ def eql?(o)
302322
# Calculates hash code according to all attributes.
303323
# @return [Fixnum] Hash code
304324
def hash
305-
[tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, type, footer, header, utm_campaign].hash
325+
[tag, sender, name, html_content, html_url, template_id, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, type, footer, header, utm_campaign, params].hash
306326
end
307327

308328
# Builds the object from hash

lib/sib-api-v3-sdk/models/create_smtp_template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CreateSmtpTemplate
3535
# Email on which campaign recipients will be able to reply to
3636
attr_accessor :reply_to
3737

38-
# This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account
38+
# To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
3939
attr_accessor :to_field
4040

4141
# Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps

lib/sib-api-v3-sdk/models/update_email_campaign.rb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class UpdateEmailCampaign
3838
# Email on which campaign recipients will be able to reply to
3939
attr_accessor :reply_to
4040

41-
# This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account
41+
# To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
4242
attr_accessor :to_field
4343

4444
attr_accessor :recipients
@@ -64,6 +64,9 @@ class UpdateEmailCampaign
6464
# Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
6565
attr_accessor :utm_campaign
6666

67+
# Pass the set of attributes to customize the type 'classic' campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}.
68+
attr_accessor :params
69+
6770

6871
# Attribute mapping from ruby-style variable name to JSON key.
6972
def self.attribute_map
@@ -84,7 +87,8 @@ def self.attribute_map
8487
:'recurring' => :'recurring',
8588
:'footer' => :'footer',
8689
:'header' => :'header',
87-
:'utm_campaign' => :'utmCampaign'
90+
:'utm_campaign' => :'utmCampaign',
91+
:'params' => :'params'
8892
}
8993
end
9094

@@ -107,7 +111,8 @@ def self.swagger_types
107111
:'recurring' => :'BOOLEAN',
108112
:'footer' => :'String',
109113
:'header' => :'String',
110-
:'utm_campaign' => :'String'
114+
:'utm_campaign' => :'String',
115+
:'params' => :'Object'
111116
}
112117
end
113118

@@ -191,6 +196,10 @@ def initialize(attributes = {})
191196
self.utm_campaign = attributes[:'utmCampaign']
192197
end
193198

199+
if attributes.has_key?(:'params')
200+
self.params = attributes[:'params']
201+
end
202+
194203
end
195204

196205
# Show invalid properties with the reasons. Usually used together with valid?
@@ -227,7 +236,8 @@ def ==(o)
227236
recurring == o.recurring &&
228237
footer == o.footer &&
229238
header == o.header &&
230-
utm_campaign == o.utm_campaign
239+
utm_campaign == o.utm_campaign &&
240+
params == o.params
231241
end
232242

233243
# @see the `==` method
@@ -239,7 +249,7 @@ def eql?(o)
239249
# Calculates hash code according to all attributes.
240250
# @return [Fixnum] Hash code
241251
def hash
242-
[tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, footer, header, utm_campaign].hash
252+
[tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, footer, header, utm_campaign, params].hash
243253
end
244254

245255
# Builds the object from hash

lib/sib-api-v3-sdk/models/update_smtp_template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class UpdateSmtpTemplate
3535
# Email on which campaign recipients will be able to reply to
3636
attr_accessor :reply_to
3737

38-
# To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These attributes must already exist in contacts database
38+
# To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization
3939
attr_accessor :to_field
4040

4141
# Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps

lib/sib-api-v3-sdk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module SibApiV3Sdk
14-
VERSION = "5.1.0"
14+
VERSION = "5.1.1"
1515
end

spec/models/create_email_campaign_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
end
6363
end
6464

65+
describe 'test attribute "template_id"' do
66+
it 'should work' do
67+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68+
end
69+
end
70+
6571
describe 'test attribute "scheduled_at"' do
6672
it 'should work' do
6773
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -144,5 +150,11 @@
144150
end
145151
end
146152

153+
describe 'test attribute "params"' do
154+
it 'should work' do
155+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
156+
end
157+
end
158+
147159
end
148160

spec/models/update_email_campaign_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,11 @@
134134
end
135135
end
136136

137+
describe 'test attribute "params"' do
138+
it 'should work' do
139+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
140+
end
141+
end
142+
137143
end
138144

0 commit comments

Comments
 (0)