ResourcesAPI documentation

mailkit.sendmail

Send message using existing email campaign and assigned template.

XML-RPC request must preserve the format displayed below.

NOTICE: Data must be encoded to Base 64 where indicated.

API call example:

XML

<?xml version="1.0"?>
<methodCall>
  <methodName>mailkit.sendmail</methodName>
  <params>
    <param>
      <value>
        <int>client_id</int>
      </value>
    </param>
    <param>
      <value>
        <string>client_md5</string>
      </value>
    </param>
    <param>
      <value>
        <int>mailinglist_id</int>
      </value>
    </param>
    <param>
      <value>
        <int>campaign_id</int>
      </value>
    </param>
    
-------recipient, subject and content-------
    
    <param>
      <value>
        <struct>
          <member>
            <name>send_to</name>
            <value>
              <string>email@sample.com</string>
            </value>
          </member>
          <member>
            <name>subject</name>
            <value>
              <string>optional subject</string>
            </value>
          </member>
          <member>
            <name>message_data</name>
            <value>
              <string>optional message body</string>
            </value>
          </member>
          <member>
            <name>content</name>
            <value>
              <struct>
                <member>
                  <name>var1</name>
                  <value>
                    <string>vairable 1</string>
                  </value>
                </member>
                <member>
                  <name>other_name</name>
                  <value>
                    <string>variable 2</string>
                  </value>
                </member>
              </struct>
            </value>
          </member>
        </struct>
      </value>
    </param>
    
-------main contact details-------
    
    <param>
      <value>
        <struct>
          <member>
            <name>status</name>
            <value>
              <string>status</string>
            </value>
          </member>
          <member>
            <name>vocative</name>
            <value>
              <string>vocative</string>
            </value>
          </member>
          <member>
            <name>prefix</name>
            <value>
              <string>prefix</string>
            </value>
          </member>
          <member>
            <name>last_name</name>
            <value>
              <string>last name</string>
            </value>
          </member>
          <member>
            <name>first_name</name>
            <value>
              <string>first name</string>
            </value>
          </member>
          <member>
            <name>reply_to</name>
            <value>
              <string>reply_to_email</string>
            </value>
          </member>
          <member>
            <name>company</name>
            <value>
              <string>company</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
    
-------additional contact details-------
    
    <param>
      <value>
        <struct>
          <member>
            <name>nick_name</name>
            <value>
              <string>nickname</string>
            </value>
          </member>
          <member>
            <name>street</name>
            <value>
              <string>adresa</string>
            </value>
          </member>
          <member>
            <name>city</name>
            <value>
              <string>city</string>
            </value>
          </member>
          <member>
            <name>country</name>
            <value>
              <string>country</string>
            </value>
          </member>
          <member>
            <name>state</name>
            <value>
              <string>state</string>
            </value>
          </member>
          <member>
            <name>zip</name>
            <value>
              <string>zip code</string>
            </value>
          </member>
          <member>
            <name>mobile</name>
            <value>
              <string>mobile</string>
            </value>
          </member>
          <member>
            <name>phone</name>
            <value>
              <string>phone number</string>
            </value>
          </member>
          <member>
            <name>fax</name>
            <value>
              <string>fax</string>
            </value>
          </member>
          <member>
            <name>gender</name>
            <value>
              <string>gender</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
    
-------custom fields-------
    
    <param>
      <value>
        <struct>
          <member>
            <name>custom1</name>
            <value>
              <string>custom field no.1</string>
            </value>
          </member>
          <member>
            <name>custom25</name>
            <value>
              <string>custom field no. 25</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
    
-------attachments-------
    
    <param>
      <value>
        <struct>
          <member>
            <name>name</name>
            <value>
              <string>filename</string>
            </value>
          </member>
          <member>
            <name>data</name>
            <value>
              <string>base64 data</string>
            </value>
          </member>
        </struct>
      </value>
    </param>

--------------
 
  </params>
</methodCall>

Values

client_id client ID can be found in your Mailkit account's menu Profile / Integration / API settings
client_md5 MD5 code can be found in your Mailkit account's menu Profile / Integration / API settings
mailinglist_id ID of mailing list, where will be the recipient added
campaign_id * = ID of campaign
send_to e-mail address of recipient
subject = optional message subject
message_data (base64) = optional message body
content (base64) = variable content that will replace the defined variables in template using tag [% shared.VAR3 -%] or [% shared.OTHER_NAME -%] or in content editor using tag [VAR3] or [OTHER_NAME].

status (base64) = status of recipient. Possible values:

  • enabled
  • disabled
  • unknown
  • temporary
  • permanent
  • unsubscribe

vocative (base64) = recipient's vocative
prefix (base64) = recipient's title
last_name (base64) = recipient's last name
first_name (base64) = recipient's first name
company (base64) = recipient's company name
nick_name (base64) = recipient's nickname
street (base64) = recipient's street
city (base64) = recipient's city
country (base64) = recipient's country
state (base64) = recipient's state
zip (base64) = recipient's ZIP code
mobile (base64) = recipient's mobile phone (international format required for SMS delivery)
phone (base64) = recipient's telephone
fax (base64) = recipient's fax
gender (base64) = recipient's gender (values - male/female)
custom1...25 (base64) = recipient's custom fields 1 - 25
attachement = optional attachments of the message:

- name = attachment filename
- data (base64) = attachment data

* required parameter

The structure of the XML request must preserve all branches. For example if the recipient additional details branch is missing but the custom fields branch is present it will be ingored as it is out of order.

Successful call response:

XML

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
		  <member>
            <name>data</name>
            <value>
              <i4>12345678</i4>
            </value>
          </member>
		  <member>
            <name>data2</name>
            <value>
              <i4>12345</i4>
            </value>
          </member>
          <member>
            <name>data3</name>
            <value>
              <i4>12345678</i4>
            </value>
          </member>
          <member>
            <name>status</name>
            <value>
              <i4>0</i4>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

Values

data = ID of newly inserted or found e-mail
data2 = ID send
data3ID send message
status

  • 0 = update (recipient data updated)
  • 1 = insert (recipient added)
  • 2 = insert (recipient is unsubscribed with status unsubscribed)
  • 3 = update (recipient is unsubscribed with status unsubscribed)
  • 4 = fault (invalid e-mail address format, recipient has been added but message not sent)
  • 6 = update (recipient updated but status is permanently undelivarable or disabled and message was not sent)
  • 7 = insert (recipient added but status is permanently undeliverable or disabled and message was not sent)

Unsuccesfull call response:

XML

<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>Missing send_to</string>
      </value>
    </param>
  </params>
</methodResponse>

Values

Invalid ID_mailing_list = invalid mailing list ID
Missing ID_mailing_list = missing mailing list ID
Invalid ID_message = invalid campaign ID
Missing ID_message = missing campaign ID
Missing send_to = missing recipient