Module: Emma::API::Mailings
- Included in:
- Client
- Defined in:
- lib/emma/api/mailings.rb
Instance Method Summary collapse
-
#cancel_queued_mailing(id) ⇒ Object
Cancels a mailing that has a current status of pending or paused.
-
#declare_winner_of_split_test(mailing_id, winner_id) ⇒ Object
Declare the winner of a split test manually.
-
#forward_mailing_to_additional_recipients(id, member_id, params = {}) ⇒ Object
Forward a previous message to additional recipients.
-
#get_groups_by_mailing(id, params = {}) ⇒ Object
Get the groups to which a particular mailing was sent.
-
#get_mailing_by_id(id) ⇒ Object
Get detailed information for one mailing.
-
#get_mailing_members(id) ⇒ Object
Get the list of members to whom the given mailing was sent.
-
#get_personalized_member_mailing(id, member_id, params = {}) ⇒ Object
Gets the personalized message content as sent to a specific member as part of the specified mailing.
-
#mailing_headsup(id) ⇒ Object
Get heads up email address(es) related to a mailing.
-
#mailing_searches(id, params = {}) ⇒ Object
Get all searches associated with a sent mailing.
-
#my_mailings(params = {}) ⇒ Object
Get information about current mailings.
-
#remove_mailing(id) ⇒ Object
Sets archived timestamp for a mailing so it is no longer included in mailing_list.
-
#send_existing_mailing(id, params = {}) ⇒ Object
Send a prior mailing to additional recipients.
-
#update_mailing(id, params = {}) ⇒ Object
Update status of a current mailing.
-
#validate_mailing(params = {}) ⇒ Object
Validate that a mailing has valid personalization-tag syntax.
Instance Method Details
#cancel_queued_mailing(id) ⇒ Object
Cancels a mailing that has a current status of pending or paused. All other statuses will result in a 404.
47 48 49 |
# File 'lib/emma/api/mailings.rb', line 47 def cancel_queued_mailing(id) delete("/mailings/cancel/#{id}") end |
#declare_winner_of_split_test(mailing_id, winner_id) ⇒ Object
Declare the winner of a split test manually. In the event that the test duration has not elapsed, the current stats for each test will be frozen and the content defined in the user declared winner will sent to the remaining members for the mailing. Please note, any messages that are pending for each of the test variations will receive the content assigned to them when the test was initially constructed.
72 73 74 |
# File 'lib/emma/api/mailings.rb', line 72 def declare_winner_of_split_test(mailing_id, winner_id) post("/mailings/#{mailing_id}/winner/#{winner_id}") end |
#forward_mailing_to_additional_recipients(id, member_id, params = {}) ⇒ Object
Forward a previous message to additional recipients. If these recipients are not already in the audience, they will be added with a status of FORWARDED.
52 53 54 |
# File 'lib/emma/api/mailings.rb', line 52 def forward_mailing_to_additional_recipients(id, member_id, params = {}) post("/forwards/#{id}/#{member_id}", params) end |
#get_groups_by_mailing(id, params = {}) ⇒ Object
Get the groups to which a particular mailing was sent.
27 28 29 |
# File 'lib/emma/api/mailings.rb', line 27 def get_groups_by_mailing(id, params = {}) get("/mailings/#{id}/groups", params) end |
#get_mailing_by_id(id) ⇒ Object
Get detailed information for one mailing.
12 13 14 |
# File 'lib/emma/api/mailings.rb', line 12 def get_mailing_by_id(id) get("/mailings/#{id}") end |
#get_mailing_members(id) ⇒ Object
Get the list of members to whom the given mailing was sent.
17 18 19 |
# File 'lib/emma/api/mailings.rb', line 17 def get_mailing_members(id) get("/mailings/#{id}/members") end |
#get_personalized_member_mailing(id, member_id, params = {}) ⇒ Object
Gets the personalized message content as sent to a specific member as part of the specified mailing.
22 23 24 |
# File 'lib/emma/api/mailings.rb', line 22 def get_personalized_member_mailing(id, member_id, params = {}) get("/mailings/#{id}/messages/#{member_id}", params) end |
#mailing_headsup(id) ⇒ Object
Get heads up email address(es) related to a mailing.
62 63 64 |
# File 'lib/emma/api/mailings.rb', line 62 def mailing_headsup(id) get("/mailings/#{id}/headsup") end |
#mailing_searches(id, params = {}) ⇒ Object
Get all searches associated with a sent mailing.
32 33 34 |
# File 'lib/emma/api/mailings.rb', line 32 def mailing_searches(id, params = {}) get("/mailings/#{id}/searches", params) end |
#my_mailings(params = {}) ⇒ Object
Get information about current mailings.
7 8 9 |
# File 'lib/emma/api/mailings.rb', line 7 def my_mailings(params = {}) get("/mailings", params) end |
#remove_mailing(id) ⇒ Object
Sets archived timestamp for a mailing so it is no longer included in mailing_list.
42 43 44 |
# File 'lib/emma/api/mailings.rb', line 42 def remove_mailing(id) delete("/mailings/#{id}") end |
#send_existing_mailing(id, params = {}) ⇒ Object
Send a prior mailing to additional recipients. A new mailing will be created that inherits its content from the original.
57 58 59 |
# File 'lib/emma/api/mailings.rb', line 57 def send_existing_mailing(id, params = {}) post("/mailings/#{id}", params) end |
#update_mailing(id, params = {}) ⇒ Object
Update status of a current mailing
37 38 39 |
# File 'lib/emma/api/mailings.rb', line 37 def update_mailing(id, params = {}) put("/mailings/#{id}", params) end |
#validate_mailing(params = {}) ⇒ Object
Validate that a mailing has valid personalization-tag syntax
67 68 69 |
# File 'lib/emma/api/mailings.rb', line 67 def validate_mailing(params = {}) post("/mailings/validate", params) end |