Area: Optimizely Campaign
Applies to versions: Not applicable


Recommended reading 

Adds a recipient to a recipient list in Optimizely Campaign. Be aware of the different behavior of this method according to the recipient status:

  • If there is already a recipient with the same ID that has not completed the opt-in process, the recipient is  removed and re-added.
  • If the recipient that is added with this method has been marked as unsubscribed and if no opt-in process ID is submitted, this recipient is activated immediately and receive mailings from your client. No further opt-in process is triggered.

Type: int


Name Type Value



ID of the session



ID of the recipient list



ID of the opt-in process

The recipient will be processed with the given opt-in process identified by this ID. If no opt-in process will be used and the recipient will be activated immediately, set the value to 0.

When using a double opt-in recipient list
: If the recipient is unsubscribed and this ID is not being transmitted, 0 is returned (recipient has been added).
When using a non-double opt-in recipient list: If the recipient is unsubscribed, regardless of whether the ID is transmitted or not, 2 is returned (recipient is unsubscribed).



ID of the recipient



Email address of the recipient


String[ ]

Defines a map of attributes in association with attributeValues


String[ ]

Defines a map of attributes in association with attributeNames

Return values

  • 0: Recipient has been added
  • 1: Recipient validation failed, e.g., due to invalid email address syntax
  • 2: Recipient is unsubscribed
  • 3: Recipient is blacklisted
  • 4: Recipient is bounce overflowed (i.e., produced too many bounces in the past)
  • 5: Recipient is already in the list
  • 6: Recipient has been filtered
  • 7: A general error occurred

Code structure

int add2(String sessionId, long recipientListId, long optinProcessId, String recipientId, String emailAddress, String[] attributeNames, String[] attributeValues) 
Do you find this information helpful? Please log in to provide feedback.

Last updated: Apr 25, 2018

Recommended reading