diff --git a/advanceUsage.md b/advanceUsage.md
new file mode 100644
index 0000000..d84f7b7
--- /dev/null
+++ b/advanceUsage.md
@@ -0,0 +1,72 @@
+#### Example of Advance Usage
+
+```python
+# -*- coding: utf-8 -*-
+from pepipost.pepipost_client import PepipostClient
+from pepipost.models.email_body import EmailBody
+from pepipost.models.personalizations import Personalizations
+from pepipost.models.attachments import Attachments
+from pepipost.models.mfrom import From
+from pepipost.models.email_body_attachments import EmailBodyAttachments
+from pepipost.models.settings import Settings
+from pepipost.exceptions.api_exception import APIException
+from pepipost.models.attributes import Attributes
+from pepipost.models.xheaders import Xheaders
+import jsonpickle
+
+client = PepipostClient()
+email_controller = client.email
+body = EmailBody()
+body.personalizations = []
+
+api_key = 'pass api-key here'
+body.personalizations.append(Personalizations())
+
+body.personalizations[0].recipient = 'my-email-id@domain.com'
+body.personalizations[0].x_apiheader_cc = 'x api header cc content'
+body.personalizations[0].x_apiheader = 'xapi header for emails'
+body.personalizations[0].attributes = Attributes('{"name":"pepi","love":"Emails"}').get_attributes()
+body.personalizations[0].attachments = []
+body.personalizations[0].attachments.append(Attachments())
+body.personalizations[0].attachments[0].file_content = '"SGVsbG8sIHRoaXMgZmlsZSBpcyBhbiBpbmZvcm1hdGlvbmFsIGZpbGU6OiBTZW5kaW5nIGVtYWlscyB0byB0aGUgaW5ib3ggaXMgd2hhdCB3ZSBkbywgYnV0IHRoYXTigJlzIG5vdCB0aGUgb25seSByZWFzb24gd2h5IGRldmVsb3BlcnMgYW5kIGVudGVycHJpc2VzIGxvdmUgdXMuIFdlIGFyZSB0aGUgb25seSBFU1AgdGhhdCBkb2VzbuKAmXQgY2hhcmdlIGZvciBlbWFpbHMgb3BlbmVkLg=="'
+body.personalizations[0].attachments[0].file_name = 'pepipost.txt'
+body.personalizations[0].recipient_cc = ['my-cc-emailid@gmail.com']
+body.personalizations[0].recipient_bcc = ['my-email-bcc-id@domain.com']
+body.personalizations[0].x_headers = Xheaders('{"custom_key1":"custom_value1","custom_key2":"custom_value2"}').get_xheaders()
+
+body.tags = 'tagsPython'
+body.mfrom = From()
+
+body.mfrom.from_email = 'pepi@net.xyz'
+body.mfrom.from_name = 'i am pepi'
+body.subject = 'Pepipost mail through php sdk'
+body.content = '
Hello, Welcome to Pepipost Family.
My name is [% name %].
my love is sending [% love %]
'
+body.ampcontent = ' Hello, AMP4EMAIL world.'
+
+body.attachments = []
+body.attachments.append(EmailBodyAttachments())
+body.attachments[0].file_content = '"SGVsbG8sIHRoaXMgZmlsZSBpcyBhbiBpbmZvcm1hdGlvbmFsIGZpbGU6OiBTZW5kaW5nIGVtYWlscyB0byB0aGUgaW5ib3ggaXMgd2hhdCB3ZSBkbywgYnV0IHRoYXTigJlzIG5vdCB0aGUgb25seSByZWFzb24gd2h5IGRldmVsb3BlcnMgYW5kIGVudGVycHJpc2VzIGxvdmUgdXMuIFdlIGFyZSB0aGUgb25seSBFU1AgdGhhdCBkb2VzbuKAmXQgY2hhcmdlIGZvciBlbWFpbHMgb3BlbmVkLg=="'
+body.attachments[0].file_name = 'pepipost_1.txt'
+
+body.settings = Settings()
+
+body.settings.footer = 1
+body.settings.clicktrack = 1
+body.settings.opentrack = 1
+body.settings.unsubscribe = 1
+body.settings.bcc = 'my-email-bcc-id@domain.com'
+body.reply_to_id = 'replyto@gmail.com'
+body.template_id = 11344
+
+URL = "https://";
+
+try:
+ result = email_controller.create_send_email(api_key, body, URL)
+ if not (result.error_info is None):
+ print("Reason :: " + str(result.error_info.error_message) + "\n" + "Message :: " + str(result.message))
+ else:
+ print("Message :: " + result.message)
+except APIException as e:
+ print(e)
+
+```
\ No newline at end of file
diff --git a/pepipost/controllers/email_controller.py b/pepipost/controllers/email_controller.py
index 1faa696..23fe1c3 100644
--- a/pepipost/controllers/email_controller.py
+++ b/pepipost/controllers/email_controller.py
@@ -19,7 +19,8 @@ class EmailController(BaseController):
def create_send_email(self,
api_key=None,
- body=None):
+ body=None,
+ url=None):
"""Does a POST request to /v2/sendEmail.
This Endpoint sends emails with the credentials passed.
@@ -43,6 +44,11 @@ def create_send_email(self,
# Prepare query URL
_query_builder = Configuration.base_uri
_query_builder += '/v2/sendEmail'
+
+ # check if url is passed
+ if url!=None and url.strip() != '':
+ _query_builder = url
+
_query_url = APIHelper.clean_url(_query_builder)
# Prepare headers
diff --git a/pepipost/models/attributes.py b/pepipost/models/attributes.py
new file mode 100644
index 0000000..4c255dd
--- /dev/null
+++ b/pepipost/models/attributes.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+"""
+ pepipost.models.attributes
+
+ This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io )
+"""
+
+from ..api_helper import APIHelper
+class Attributes:
+
+ """Implementation of the 'Attributes' model.
+
+ TODO: type model description here.
+
+ Attributes:
+ attributes (string): TODO: type description here.
+ """
+
+ def __init__(self,
+ attributes):
+ """Constructor for the Attributes class"""
+
+ # Initialize members of the class
+ self.attributes = attributes
+
+
+ def get_attributes(self):
+ """Creates an instance of this model from a dictionary
+
+ Args:
+ JSON (string): A key value pair json string.
+
+ Returns:
+ dictionary : dictionary mapping of passed attributes
+
+ """
+ if self.attributes == "" or self.attributes == None:
+ return None
+
+ return APIHelper.json_deserialize(self.attributes)
+
+
+
+
diff --git a/pepipost/models/email_body.py b/pepipost/models/email_body.py
index fdba285..26663a2 100644
--- a/pepipost/models/email_body.py
+++ b/pepipost/models/email_body.py
@@ -23,6 +23,7 @@ class EmailBody(object):
mfrom (From): TODO: type description here.
subject (string): TODO: type description here.
content (string): TODO: type description here.
+ ampcontent (string): TODO: type description here.
attachments (list of EmailBodyAttachments): TODO: type description
here.
settings (Settings): TODO: type description here.
@@ -38,6 +39,7 @@ class EmailBody(object):
"mfrom":'from',
"subject":'subject',
"content":'content',
+ "ampcontent":'ampcontent',
"attachments":'attachments',
"settings":'settings',
"reply_to_id":'replyToId',
@@ -50,6 +52,7 @@ def __init__(self,
mfrom=None,
subject=None,
content=None,
+ ampcontent=None,
attachments=None,
settings=None,
reply_to_id=None,
@@ -62,6 +65,7 @@ def __init__(self,
self.mfrom = mfrom
self.subject = subject
self.content = content
+ self.ampcontent = ampcontent
self.attachments = attachments
self.settings = settings
self.reply_to_id = reply_to_id
@@ -95,6 +99,7 @@ def from_dictionary(cls,
mfrom = pepipost.models.mfrom.From.from_dictionary(dictionary.get('from')) if dictionary.get('from') else None
subject = dictionary.get('subject')
content = dictionary.get('content')
+ ampcontent = dictionary.get('ampcontent')
attachments = None
if dictionary.get('attachments') != None:
attachments = list()
@@ -110,6 +115,7 @@ def from_dictionary(cls,
mfrom,
subject,
content,
+ ampcontent,
attachments,
settings,
reply_to_id,
diff --git a/pepipost/models/personalizations.py b/pepipost/models/personalizations.py
index 285f8e2..fe26ebe 100644
--- a/pepipost/models/personalizations.py
+++ b/pepipost/models/personalizations.py
@@ -20,6 +20,8 @@ class Personalizations(object):
attributes (object): TODO: type description here.
attachments (list of Attachments): TODO: type description here.
recipient_cc (list of string): TODO: type description here.
+ recipient_bcc (list of string): TODO: type description here.
+ x_headers (object): TODO: type description here.
"""
@@ -30,7 +32,9 @@ class Personalizations(object):
"x_apiheader":'x-apiheader',
"attributes":'attributes',
"attachments":'attachments',
- "recipient_cc":'recipient_cc'
+ "recipient_cc":'recipient_cc',
+ "recipient_bcc":'recipient_bcc',
+ "x_headers":'x-headers'
}
def __init__(self,
@@ -39,7 +43,9 @@ def __init__(self,
x_apiheader=None,
attributes=None,
attachments=None,
- recipient_cc=None):
+ recipient_cc=None,
+ recipient_bcc=None,
+ x_headers=None):
"""Constructor for the Personalizations class"""
# Initialize members of the class
@@ -49,6 +55,8 @@ def __init__(self,
self.attributes = attributes
self.attachments = attachments
self.recipient_cc = recipient_cc
+ self.recipient_bcc = recipient_bcc
+ self.x_headers = x_headers
@classmethod
@@ -79,6 +87,8 @@ def from_dictionary(cls,
for structure in dictionary.get('attachments'):
attachments.append(pepipost.models.attachments.Attachments.from_dictionary(structure))
recipient_cc = dictionary.get('recipient_cc')
+ recipient_bcc = dictionary.get('recipient_bcc')
+ x_headers = dictionary.get('x-headers')
# Return an object of this model
return cls(recipient,
@@ -86,6 +96,8 @@ def from_dictionary(cls,
x_apiheader,
attributes,
attachments,
- recipient_cc)
+ recipient_cc,
+ recipient_bcc,
+ x_headers)
diff --git a/pepipost/models/xheaders.py b/pepipost/models/xheaders.py
new file mode 100644
index 0000000..16848a4
--- /dev/null
+++ b/pepipost/models/xheaders.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+
+"""
+ pepipost.models.attributes
+
+ This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io )
+"""
+
+from ..api_helper import APIHelper
+class Xheaders:
+
+ """Implementation of the 'Attributes' model.
+
+ TODO: type model description here.
+
+ Attributes:
+ xheaders (string): TODO: type description here.
+ """
+
+ def __init__(self,
+ xheaders):
+ """Constructor for the xheaders class"""
+
+ # Initialize members of the class
+ self.xheaders = xheaders
+
+
+ def get_xheaders(self):
+ """Creates an instance of this model from a dictionary
+
+ Args:
+ JSON (string): A key value pair json string.
+
+ Returns:
+ dictionary : dictionary mapping of passed xheaders
+
+ """
+
+ if self.xheaders == "" or self.xheaders == None:
+ return None
+
+ return APIHelper.json_deserialize(self.xheaders)
+
+