The Email API allows you to create and update contacts by including specially formatted code in the body of email received in Relenta:


### BEGIN CREATE CONTACT ###
API_KEY:
EMAIL:
FULL_NAME:
FIRST_NAME:
LAST_NAME:
JOB_TITLE:
COMPANY:
CONTACT_COMMENTS:
PHONE(LABEL):
WEBSITE(LABEL):
MESSENGER(LABEL):
FAX(LABEL):
CUSTOM_FIELD(FIELD_NAME):
ADDRESS(LABEL):#START#

#END#
TEXT(LABEL):#START#

#END#
BLOCK NAME|PHONE(LABEL):
GROUPS: {comma-delimited list of group IDs}
OPTIONS: {overwrite/update/cancel}
MATCH_BY: {comma-delimited list of contact fields}
REMOVE_THIS_BLOCK: {yes/not}
### END CREATE CONTACT ###

The API_KEY, Group ID and Custom Field strings can be found under the Account Dashboard > API tab.

API_KEY is optional unless OPTIONS is set to “overwrite” or “update.”

Either FULL_NAME or FIRST_NAME and LAST_NAME should be used, but not both. The FULL_NAME string will be split into first and last names.

(LABEL) value is optional

#START# and #END# markers are required only for multi-line values (such as address or text field)

If REMOVE_THIS_BLOCK is set to Yes, all text between and including ### BEGIN CREATE CONTACT ### and ### END CREATE CONTACT ### will be removed from email body.

The option to {Overwrite/Update/Cancel} refers to the situations when a contact with given email already exists in the department database.

Overwrite: all contact info is completely replaced

Update: Fields with singular possible values (such as first and last name, email, comments, company, job title) are replaced; fields with multiple possible values are appended to the existing ones

Cancel: no changes made

The following fields can be used in MATCH_BY: contact_id, email, first_name, last_name, job_title, company. If the fields listed in MATCH_BY match an existing contact, it will be updated. Otherwise, a new contact will be created. If MATCH_BY fields aren’t defined, the default match-by-email-only will be used.

Example

### BEGIN CREATE CONTACT ###
API_KEY: c394dr5723te9f874qbb923dl8345
EMAIL: james.bond@mi6.gov.uk
FULL_NAME: James Bond
JOB_TITLE: Agent
COMPANY: Secret Intelligence Service
CONTACT_COMMENTS: Licensed to kill
PHONE(work): +44 347928374289
WEBSITE(work): www.mi6.gov.uk
MESSENGER(Skype): jamesbond
FAX: +44 384573957345
CUSTOM_FIELD(FAVORITE_COCKTAIL):Vodka Martini
ADDRESS:#START#
PO Box 1300
London SE1 1BD
United Kingdom
#END#
TEXT(customer comments):#START#
That's pretty potent. Not the cork. Your after-shave.
Strong enough to bury anything. But the wine is quite
excellent. Although for such a grand meal, I would have
expected a claret.
#END#
Billing info|PHONE(billing): +44 90281465543
GROUPS: 12538044
OPTIONS: update
MATCH_BY: email, first_name, last_name
REMOVE_THIS_BLOCK: No
### END CREATE CONTACT ###