Commits

MailChimp committed 8cefee2

Add embedded image support

Comments (0)

Files changed (2)

         params = json.dumps(params)
         self.log('POST to %s%s.json: %s' % (ROOT, url, params))
         start = time.time()
-        r = self.session.post('%s%s.json' % (ROOT, url), data=params, headers={'content-type': 'application/json', 'user-agent': 'Mandrill-Python/1.0.15'})
+        r = self.session.post('%s%s.json' % (ROOT, url), data=params, headers={'content-type': 'application/json', 'user-agent': 'Mandrill-Python/1.0.16'})
         try:
             remote_addr = r.raw._original_response.fp._sock.getpeername() # grab the remote_addr before grabbing the text since the socket will go away
         except:
                    [].soft_bounces (integer): the number of emails that soft bounced during the hour
                    [].rejects (integer): the number of emails that were rejected during the hour
                    [].complaints (integer): the number of spam complaints received during the hour
+                   [].unsubs (integer): the number of unsubscribes received during the hour
                    [].opens (integer): the number of emails opened during the hour
                    [].unique_opens (integer): the number of unique opens generated by messages sent during the hour
                    [].clicks (integer): the number of tracked URLs clicked during the hour
                    [].soft_bounces (integer): the number of emails that soft bounced during the hour
                    [].rejects (integer): the number of emails that were rejected during the hour
                    [].complaints (integer): the number of spam complaints received during the hour
+                   [].unsubs (integer): the number of unsubscribes received during the hour
                    [].opens (integer): the number of emails opened during the hour
                    [].unique_opens (integer): the number of unique opens generated by messages sent during the hour
                    [].clicks (integer): the number of tracked URLs clicked during the hour
 
                message.attachments (array): an array of supported attachments to add to the message::
                    message.attachments[] (struct): a single supported attachment::
-                       message.attachments[].type (string): the MIME type of the attachment - allowed types are text/*, image/*, and application/pdf
+                       message.attachments[].type (string): the MIME type of the attachment
                        message.attachments[].name (string): the file name of the attachment
                        message.attachments[].content (string): the content of the attachment as a base64-encoded string
 
 
+               message.images (array): an array of embedded images to add to the message::
+                   message.images[] (struct): a single embedded image::
+                       message.images[].type (string): the MIME type of the image - must start with "image/"
+                       message.images[].name (string): the Content ID of the image - use <img src="cid:THIS_VALUE"> to reference the image in your HTML content
+                       message.images[].content (string): the content of the image as a base64-encoded string
+
+
            async (boolean): enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
 
         Returns:
 
                message.attachments (array): an array of supported attachments to add to the message::
                    message.attachments[] (struct): a single supported attachment::
-                       message.attachments[].type (string): the MIME type of the attachment - allowed types are text/*, image/*, and application/pdf
+                       message.attachments[].type (string): the MIME type of the attachment
                        message.attachments[].name (string): the file name of the attachment
                        message.attachments[].content (string): the content of the attachment as a base64-encoded string
 
 
+               message.images (array): an array of embedded images to add to the message::
+                   message.images[] (struct): a single embedded image::
+                       message.images[].type (string): the MIME type of the image - must start with "image/"
+                       message.images[].name (string): the Content ID of the image - use <img src="cid:THIS_VALUE"> to reference the image in your HTML content
+                       message.images[].content (string): the content of the image as a base64-encoded string
+
+
            async (boolean): enable a background sending mode that is optimized for bulk sending. In async mode, messages/sendTemplate will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
 
         Returns:
                        attachments[].content (string): the content of the attachment as a text string or a base64 encoded string based on the attachment type
 
 
+               images (array): an array of any embedded images that can be found in the message::
+                   images[] (struct): information about an individual image::
+                       images[].name (string): the Content-ID of the embedded image
+                       images[].type (string): the MIME type of the image
+                       images[].content (string): the content of the image as a base64 encoded string
+
+
 
         Raises:
            InvalidKeyError: The provided API key is not a valid Mandrill API key
 
 setup(
     name = 'mandrill',
-    version = '1.0.15',
+    version = '1.0.16',
     author = 'Mandrill Devs',
     author_email = 'community@mandrill.com',
     description = 'A CLI client and Python API library for the Mandrill email as a service platform.',