@@ -40,6 +40,7 @@ def _translate_keys(self, **kwargs):
4040 model ['options' ]['transactional' ] = kwargs .get ('transactional' )
4141 model ['options' ]['sandbox' ] = kwargs .get ('use_sandbox' )
4242 model ['options' ]['skip_suppression' ] = kwargs .get ('skip_suppression' )
43+ model ['options' ]['ip_pool' ] = kwargs .get ('ip_pool' )
4344 model ['options' ]['inline_css' ] = kwargs .get ('inline_css' )
4445
4546 model ['content' ]['use_draft_template' ] = \
@@ -77,6 +78,10 @@ def _translate_keys(self, **kwargs):
7778 model ['content' ]['attachments' ] = self ._extract_attachments (
7879 attachments )
7980
81+ inline_images = kwargs .get ('inline_images' , [])
82+ model ['content' ]['inline_images' ] = self ._extract_attachments (
83+ inline_images )
84+
8085 return model
8186
8287 def _format_copies (self , recipients , copies ):
@@ -176,6 +181,26 @@ def send(self, **kwargs):
176181 name='document.pdf',
177182 filename='/full/path/to/document.pdf'
178183 )
184+ :param inline_images: List of dicts. For example:
185+
186+ .. code-block:: python
187+
188+ dict(
189+ type='image/png',
190+ name='imageCID',
191+ data='base64 encoded string'
192+ )
193+
194+ Replace `data` with `filename` if you want the library to perform
195+ the base64 conversion. For example:
196+
197+ .. code-block:: python
198+
199+ dict(
200+ type='image/png',
201+ name='imageCID',
202+ filename='/full/path/to/image.png'
203+ )
179204
180205 :param str start_time: Delay generation of messages until this
181206 datetime. Format YYYY-MM-DDTHH:MM:SS+-HH:MM. Example:
@@ -192,6 +217,8 @@ def send(self, **kwargs):
192217 :param bool skip_suppression: Whether or not to ignore customer
193218 suppression rules, for this transmission only. Only applicable if
194219 your configuration supports this parameter. (SparkPost Elite only)
220+ :param str ip_pool: The name of a dedicated IP pool associated with
221+ your account
195222 :param bool inline_css: Whether or not to perform CSS inlining
196223 :param dict custom_headers: Used to set any headers associated with
197224 transmission
0 commit comments