Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add more methods to work with sends

  • Loading branch information...
commit a3b9d327f7a7de8a36db60a706528088bd52f419 1 parent 0d9ac8d
Vitaliy Podoba authored

Showing 1 changed file with 26 additions and 2 deletions. Show diff stats Hide diff stats

  1. +26 2 icontact/client.py
28 icontact/client.py
@@ -423,10 +423,10 @@ def messages(self, account_id=None, client_folder_id=None):
423 423 result = self._do_request('a/%s/c/%s/messages/' % (account_id, client_folder_id))
424 424 return result
425 425
426   - def send(self, messageId, includeListIds, account_id=None,
  426 + def create_send(self, messageId, includeListIds, account_id=None,
427 427 client_folder_id=None, **kwargs):
428 428 """
429   - Sends a message.
  429 + Creates a send.
430 430 """
431 431 account_id, client_folder_id = self._required_values(account_id, client_folder_id)
432 432 alert = dict(messageId=messageId, includeListIds=','.join(includeListIds))
@@ -438,6 +438,30 @@ def send(self, messageId, includeListIds, account_id=None,
438 438 method='post')
439 439 return result
440 440
  441 + def delete_send(self, sendId, account_id=None, client_folder_id=None):
  442 + """
  443 + Deletes send.
  444 + """
  445 + account_id, client_folder_id = self._required_values(account_id,
  446 + client_folder_id)
  447 +
  448 + result = self._do_request('a/%s/c/%s/sends/%s' %
  449 + (account_id, client_folder_id, sendId),
  450 + method='delete')
  451 + return result
  452 +
  453 + def get_send(self, sendId, account_id=None, client_folder_id=None):
  454 + """
  455 + Gets send.
  456 + """
  457 + account_id, client_folder_id = self._required_values(account_id,
  458 + client_folder_id)
  459 +
  460 + result = self._do_request('a/%s/c/%s/sends/%s' %
  461 + (account_id, client_folder_id, sendId),
  462 + method='get')
  463 + return result
  464 +
441 465 class FixedOffset(tzinfo):
442 466 """
443 467 Fixed offset value that extends the `datetime.tzinfo` object to

0 comments on commit a3b9d32

Please sign in to comment.
Something went wrong with that request. Please try again.