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_recipients(recipients) ⇒ 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) ⇒ 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.
448 449 450 |
# File 'lib/mailup/console/list.rb', line 448 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.
511 512 513 |
# File 'lib/mailup/console/list.rb', line 511 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.
560 561 562 |
# File 'lib/mailup/console/list.rb', line 560 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.
532 533 534 |
# File 'lib/mailup/console/list.rb', line 532 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.
348 349 350 |
# File 'lib/mailup/console/list.rb', line 348 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.
748 749 750 |
# File 'lib/mailup/console/list.rb', line 748 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.
419 420 421 |
# File 'lib/mailup/console/list.rb', line 419 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
466 467 468 |
# File 'lib/mailup/console/list.rb', line 466 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
624 625 626 |
# File 'lib/mailup/console/list.rb', line 624 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
393 394 395 |
# File 'lib/mailup/console/list.rb', line 393 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.
683 684 685 |
# File 'lib/mailup/console/list.rb', line 683 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.
488 489 490 |
# File 'lib/mailup/console/list.rb', line 488 def images(params = {}) @api.get("#{@api.path}/List/#{@id}/Images", params: params) end |
#import_recipients(recipients) ⇒ Integer
Import multiple recipients to a list.
264 265 266 |
# File 'lib/mailup/console/list.rb', line 264 def import_recipients(recipients) @api.post("#{@api.path}/List/#{@id}/Recipients", 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"
651 652 653 |
# File 'lib/mailup/console/list.rb', line 651 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.
715 716 717 |
# File 'lib/mailup/console/list.rb', line 715 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.
777 778 779 |
# File 'lib/mailup/console/list.rb', line 777 def send_history(, params = {}) @api.get("#{@api.path}/List/#{@id}/Email/#{}/SendHistory", params: params) end |
#send_message(message_id) ⇒ JSON
Send an email message to the recipients in the specified list.
799 800 801 |
# File 'lib/mailup/console/list.rb', line 799 def () @api.post("#{@api.path}/List/#{@id}/Email/#{}/Send") end |
#subscribe(recipient_id) ⇒ Boolean
Subscribe a recipient from the specified list.
281 282 283 |
# File 'lib/mailup/console/list.rb', line 281 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.
328 329 330 |
# File 'lib/mailup/console/list.rb', line 328 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.
857 858 859 |
# File 'lib/mailup/console/list.rb', line 857 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.
829 830 831 |
# File 'lib/mailup/console/list.rb', line 829 def templates(params = {}) @api.get("#{@api.path}/List/#{@id}/Templates", params: params) end |
#unsubscribe(recipient_id) ⇒ Boolean
Unsubscribe a recipient in the specified list.
298 299 300 |
# File 'lib/mailup/console/list.rb', line 298 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.
589 590 591 |
# File 'lib/mailup/console/list.rb', line 589 def (, ) @api.put("#{@api.path}/List/#{@id}/Email/#{}", body: ) end |
#update_message_visibility(message_id, visibility) ⇒ Boolean
Modify the email message online visibility.
607 608 609 |
# File 'lib/mailup/console/list.rb', line 607 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.
376 377 378 |
# File 'lib/mailup/console/list.rb', line 376 def update_tag(tag_id, tag) @api.put("#{@api.path}/List/#{@id}/Tag/#{tag_id}", body: tag) end |