Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

containsValid

Queries whether a recipient can receive mailings (is valid) in Optimizely Campaign.

Queries whether a recipient can receive mailings (is valid) in Optimizely Campaign by checking the following conditions:

  • already exists in a recipient list
  • is not blocked in a recipient list
  • is not unsubscribed in a recipient list
  • is not bounced-out in a recipient list
  • has finished an opt-in process (if any opt-in process exists) in a recipient list

By default, the media type EMAIL is used. Use the setMediaType method to select another media type such as SMS.

Type: boolean

Parameters

NameTypeValue
sessionIdStringID of the session
recipientListIdlongID of the recipient list
recipientIdStringID of the recipient

Return values

  • true: Recipient matches all conditions and receives mailings
  • false: Recipient does not match at least one condition and does not receive any mailing

Code structure

boolean containsValid(String sessionId, long recipientListId, String recipientId)