Class: MailUp::Console::List
- Inherits:
-
Object
- Object
- MailUp::Console::List
- Defined in:
- lib/mailup/console/list.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Instance Method Summary collapse
-
#add_attachment(message_id, slot, attachment) ⇒ JSON
Add an attachment to the specified message.
-
#add_group(group) ⇒ JSON
Create a new group for the specified list.
-
#add_image(image) ⇒ String
Add a new image to the specified mailing list.
-
#add_message(message) ⇒ JSON
Create an email message in the specified list id.
-
#add_message_from_template(template_id) ⇒ JSON
Create an email message in the specified list id from template.
-
#add_tag(tag) ⇒ JSON
Add a new tag in the specified list.
-
#archived_emails(params = {}) ⇒ JSON
Retrieve the archived email messages by the specified list id.
-
#attachments(message_id, params = {}) ⇒ JSON
Get the attachment list for the specific message.
-
#delete_attachment(message_id, slot) ⇒ Boolean
Delete an attachment from the specified message.
-
#delete_group(group_id) ⇒ Boolean
Delete a group from the specified list.
-
#delete_message(message_id) ⇒ Boolean
Delete an email message from the specified list id.
-
#delete_tag(tag_id) ⇒ Boolean
Delete a tag from the specified list.
-
#emails(params = {}) ⇒ JSON
Retrieve email messages (cloned and uncloned) for this list.
-
#groups(params = {}) ⇒ JSON
Retrieve groups for the specified list.
-
#images(params = {}) ⇒ Array<String>
Get all the images for the specified list.
-
#import_recipient(recipient, params = {}) ⇒ Integer
Import a single recipient to a list(synchronous import).
-
#import_recipients(recipients, params = {}) ⇒ Integer
Import multiple recipients to a list.
-
#initialize(id, api) ⇒ List
constructor
A new instance of List.
-
#message_details(message_id) ⇒ JSON
Retrieve the email message details by specified id.
-
#online_emails(params = {}) ⇒ JSON
(also: #visible_emails)
Retrieve the email messages visible online through the website by the specified list id.
-
#pending(params = {}) ⇒ JSON
Retrieve pending recipients in the specified list.
-
#recipient_groups(recipient_id, params = {}) ⇒ JSON
Retrieve the groups subscribed by the recipient in the specified list.
-
#send_history(message_id, params = {}) ⇒ JSON
Get email message send history.
-
#send_message(message_id, params = {}) ⇒ JSON
Send an email message to the recipients in the specified list.
-
#subscribe(recipient_id) ⇒ Boolean
Subscribe a recipient from the specified list.
-
#subscribed(params = {}) ⇒ JSON
Retrieve subscribed recipients in the specified list.
-
#tags(params = {}) ⇒ JSON
(also: #enabled_tags)
Get the enabled tag list for the specified list id.
-
#template_details(template_id) ⇒ JSON
Retrieve the details for the specified message template in the specified list.
-
#templates(params = {}) ⇒ JSON
Retrieve the list of the current defined message templates in the specified list.
-
#unsubscribe(recipient_id) ⇒ Boolean
Unsubscribe a recipient in the specified list.
-
#unsubscribed(params = {}) ⇒ JSON
Retrieve unsubscribed recipients in the specified list.
-
#update_group(group_id, group) ⇒ JSON
Update a group for the specified list.
-
#update_message(message_id, message) ⇒ JSON
Modify an email message in the specified list id.
-
#update_message_visibility(message_id, visibility) ⇒ Boolean
Modify the email message online visibility.
-
#update_tag(tag_id, tag) ⇒ JSON
Update a tag in the specified list.
Constructor Details
#initialize(id, api) ⇒ List
Returns a new instance of List.
6 7 8 9 |
# File 'lib/mailup/console/list.rb', line 6 def initialize(id, api) @api = api @id = id end |
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
4 5 6 |
# File 'lib/mailup/console/list.rb', line 4 def api @api end |
Instance Method Details
#add_attachment(message_id, slot, attachment) ⇒ JSON
Add an attachment to the specified message.
474 475 476 |
# File 'lib/mailup/console/list.rb', line 474 def (, slot, ) @api.post("#{@api.path}/List/#{@id}/Email/#{}/Attachment/#{slot}", body: ) end |
#add_group(group) ⇒ JSON
Create a new group for the specified list.
69 70 71 |
# File 'lib/mailup/console/list.rb', line 69 def add_group(group) @api.post("#{@api.path}/List/#{@id}/Group", body: group) end |
#add_image(image) ⇒ String
Add a new image to the specified mailing list.
537 538 539 |
# File 'lib/mailup/console/list.rb', line 537 def add_image(image) @api.post("#{@api.path}/List/#{@id}/Images", body: image) end |
#add_message(message) ⇒ JSON
Create an email message in the specified list id.
586 587 588 |
# File 'lib/mailup/console/list.rb', line 586 def () @api.post("#{@api.path}/List/#{@id}/Email", body: ) end |
#add_message_from_template(template_id) ⇒ JSON
Create an email message in the specified list id from template.
558 559 560 |
# File 'lib/mailup/console/list.rb', line 558 def (template_id) @api.post("#{@api.path}/List/#{@id}/Email/Template/#{template_id}") end |
#add_tag(tag) ⇒ JSON
Add a new tag in the specified list.
374 375 376 |
# File 'lib/mailup/console/list.rb', line 374 def add_tag(tag) @api.post("#{@api.path}/List/#{@id}/Tag", body: tag) end |
#archived_emails(params = {}) ⇒ JSON
Retrieve the archived email messages by the specified list id.
774 775 776 |
# File 'lib/mailup/console/list.rb', line 774 def archived_emails(params = {}) @api.get("#{@api.path}/List/#{@id}/Archived/Emails", params: params) end |
#attachments(message_id, params = {}) ⇒ JSON
Get the attachment list for the specific message.
445 446 447 |
# File 'lib/mailup/console/list.rb', line 445 def (, params = {}) @api.get("#{@api.path}/List/#{@id}/Email/#{}/Attachment", params: params) end |
#delete_attachment(message_id, slot) ⇒ Boolean
Delete an attachment from the specified message.
Example:
delete = mailup.console.list(2).delete_attachment(49, 3)
=> true
492 493 494 |
# File 'lib/mailup/console/list.rb', line 492 def (, slot) @api.delete("#{@api.path}/List/#{@id}/Email/#{}/#{slot}") end |
#delete_group(group_id) ⇒ Boolean
Delete a group from the specified list.
Example:
delete = mailup.console.list(2).delete_group(49)
=> true
117 118 119 |
# File 'lib/mailup/console/list.rb', line 117 def delete_group(group_id) @api.delete("#{@api.path}/List/#{@id}/Group/#{group_id}") end |
#delete_message(message_id) ⇒ Boolean
Delete an email message from the specified list id.
Example:
delete = mailup.console.list(2).delete_message(49)
=> true
650 651 652 |
# File 'lib/mailup/console/list.rb', line 650 def () @api.delete("#{@api.path}/List/#{@id}/Email/#{}") end |
#delete_tag(tag_id) ⇒ Boolean
Delete a tag from the specified list.
Example:
delete = mailup.console.list(2).delete_tag(1)
=> true
419 420 421 |
# File 'lib/mailup/console/list.rb', line 419 def delete_tag(tag_id) @api.delete("#{@api.path}/List/#{@id}/Tag/#{tag_id}") end |
#emails(params = {}) ⇒ JSON
Retrieve email messages (cloned and uncloned) for this list.
709 710 711 |
# File 'lib/mailup/console/list.rb', line 709 def emails(params = {}) @api.get("#{@api.path}/List/#{@id}/Emails", params: params) end |
#groups(params = {}) ⇒ JSON
Retrieve groups for the specified list
38 39 40 |
# File 'lib/mailup/console/list.rb', line 38 def groups(params = {}) @api.get("#{@api.path}/List/#{@id}/Groups", params: params) end |
#images(params = {}) ⇒ Array<String>
Get all the images for the specified list.
514 515 516 |
# File 'lib/mailup/console/list.rb', line 514 def images(params = {}) @api.get("#{@api.path}/List/#{@id}/Images", params: params) end |
#import_recipient(recipient, params = {}) ⇒ Integer
Import a single recipient to a list(synchronous import).
268 269 270 |
# File 'lib/mailup/console/list.rb', line 268 def import_recipient(recipient, params = {}) @api.post("#{@api.path}/List/#{@id}/Recipient", {params: params, body: recipient}) end |
#import_recipients(recipients, params = {}) ⇒ Integer
Import multiple recipients to a list.
290 291 292 |
# File 'lib/mailup/console/list.rb', line 290 def import_recipients(recipients, params = {}) @api.post("#{@api.path}/List/#{@id}/Recipients", {params: params, body: recipients}) end |
#message_details(message_id) ⇒ JSON
Retrieve the email message details by specified id.
Example:
message = mailup.console.list(2).message_details(49)
message['Subject']
=> "Message Subject"
677 678 679 |
# File 'lib/mailup/console/list.rb', line 677 def () @api.get("#{@api.path}/List/#{@id}/Email/#{}") end |
#online_emails(params = {}) ⇒ JSON Also known as: visible_emails
Retrieve the email messages visible online through the website by the specified list id.
741 742 743 |
# File 'lib/mailup/console/list.rb', line 741 def online_emails(params = {}) @api.get("#{@api.path}/List/#{@id}/Online/Emails", params: params) end |
#pending(params = {}) ⇒ JSON
Retrieve pending recipients in the specified list.
182 183 184 |
# File 'lib/mailup/console/list.rb', line 182 def pending(params = {}) @api.get("#{@api.path}/List/#{@id}/Recipients/Pending", params: params) end |
#recipient_groups(recipient_id, params = {}) ⇒ JSON
Retrieve the groups subscribed by the recipient in the specified list.
150 151 152 |
# File 'lib/mailup/console/list.rb', line 150 def recipient_groups(recipient_id, params = {}) @api.get("#{@api.path}/List/#{@id}/Recipient/#{recipient_id}/Groups", params: params) end |
#send_history(message_id, params = {}) ⇒ JSON
Get email message send history.
803 804 805 |
# File 'lib/mailup/console/list.rb', line 803 def send_history(, params = {}) @api.get("#{@api.path}/List/#{@id}/Email/#{}/SendHistory", params: params) end |
#send_message(message_id, params = {}) ⇒ JSON
Send an email message to the recipients in the specified list.
827 828 829 |
# File 'lib/mailup/console/list.rb', line 827 def (, params = {}) @api.post("#{@api.path}/List/#{@id}/Email/#{}/Send", params: params) end |
#subscribe(recipient_id) ⇒ Boolean
Subscribe a recipient from the specified list.
307 308 309 |
# File 'lib/mailup/console/list.rb', line 307 def subscribe(recipient_id) @api.post("#{@api.path}/List/#{@id}/Subscribe/#{recipient_id}") end |
#subscribed(params = {}) ⇒ JSON
Retrieve subscribed recipients in the specified list.
214 215 216 |
# File 'lib/mailup/console/list.rb', line 214 def subscribed(params = {}) @api.get("#{@api.path}/List/#{@id}/Recipients/Subscribed", params: params) end |
#tags(params = {}) ⇒ JSON Also known as:
Get the enabled tag list for the specified list id.
354 355 356 |
# File 'lib/mailup/console/list.rb', line 354 def (params = {}) @api.get("#{@api.path}/List/#{@id}/Tags", params: params) end |
#template_details(template_id) ⇒ JSON
Retrieve the details for the specified message template in the specified list.
885 886 887 |
# File 'lib/mailup/console/list.rb', line 885 def template_details(template_id) @api.get("#{@api.path}/List/#{@id}/Templates/#{template_id}") end |
#templates(params = {}) ⇒ JSON
Retrieve the list of the current defined message templates in the specified list.
857 858 859 |
# File 'lib/mailup/console/list.rb', line 857 def templates(params = {}) @api.get("#{@api.path}/List/#{@id}/Templates", params: params) end |
#unsubscribe(recipient_id) ⇒ Boolean
Unsubscribe a recipient in the specified list.
324 325 326 |
# File 'lib/mailup/console/list.rb', line 324 def unsubscribe(recipient_id) @api.delete("#{@api.path}/List/#{@id}/Unsubscribe/#{recipient_id}") end |
#unsubscribed(params = {}) ⇒ JSON
Retrieve unsubscribed recipients in the specified list.
246 247 248 |
# File 'lib/mailup/console/list.rb', line 246 def unsubscribed(params = {}) @api.get("#{@api.path}/List/#{@id}/Recipients/Unsubscribed", params: params) end |
#update_group(group_id, group) ⇒ JSON
Update a group for the specified list.
100 101 102 |
# File 'lib/mailup/console/list.rb', line 100 def update_group(group_id, group) @api.put("#{@api.path}/List/#{@id}/Group/#{group_id}", body: group) end |
#update_message(message_id, message) ⇒ JSON
Modify an email message in the specified list id.
615 616 617 |
# File 'lib/mailup/console/list.rb', line 615 def (, ) @api.put("#{@api.path}/List/#{@id}/Email/#{}", body: ) end |
#update_message_visibility(message_id, visibility) ⇒ Boolean
Modify the email message online visibility.
633 634 635 |
# File 'lib/mailup/console/list.rb', line 633 def (, visibility) @api.put("#{@api.path}/List/#{@id}/Email/#{}/Online/Visibility", body: visibility) end |
#update_tag(tag_id, tag) ⇒ JSON
Update a tag in the specified list.
402 403 404 |
# File 'lib/mailup/console/list.rb', line 402 def update_tag(tag_id, tag) @api.put("#{@api.path}/List/#{@id}/Tag/#{tag_id}", body: tag) end |