Commits

Dustin Shields-Cloues committed 1fe4eeb

Messages with multiple recipients can now specify unique metadata for each recipient

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.6'})
+        r = self.session.post('%s%s.json' % (ROOT, url), data=params, headers={'content-type': 'application/json', 'user-agent': 'Mandrill-Python/1.0.7'})
         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:
                message.google_analytics_domains (array): an array of strings indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically.
                message.google_analytics_campaign (array|string): optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.
                message.metadata (array): metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
+               message.recipient_metadata (array): Per-recipient metadata that will override the global values specified in the metadata parameter.::
+                   message.recipient_metadata[] (struct): metadata for a single recipient::
+                       message.recipient_metadata[].rcpt (string): the email address of the recipient that the metadata is associated with
+                       message.recipient_metadata[].values (array): an associated array containing the recipient's unique metadata. If a key exists in both the per-recipient metadata and the global metadata, the per-recipient metadata will be used.
+
+
                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.google_analytics_domains (array): an array of strings indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically.
                message.google_analytics_campaign (array|string): optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.
                message.metadata (array): metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
+               message.recipient_metadata (array): Per-recipient metadata that will override the global values specified in the metadata parameter.::
+                   message.recipient_metadata[] (struct): metadata for a single recipient::
+                       message.recipient_metadata[].rcpt (string): the email address of the recipient that the metadata is associated with
+                       message.recipient_metadata[].values (array): an associated array containing the recipient's unique metadata. If a key exists in both the per-recipient metadata and the global metadata, the per-recipient metadata will be used.
+
+
                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
 
 setup(
     name = 'mandrill',
-    version = '1.0.6',
+    version = '1.0.7',
     author = 'Mandrill Devs',
     author_email = 'community@mandrill.com',
     description = 'A CLI client and Python API library for the Mandrill email as a service platform.',