Set opt-out Status

Set opt-out status for the specified email contact.


Function

  • setContactOptOutStatus()

Parameters

  • username: String
    • Account login name.
  • password: String
    • Account password.
  • contactId: long
    • email/contact to set the opt-out status for
  • hasOptOut: boolean
    • whether contact has opted out (true = opted out)

Return

  • int:
    • 1: success
    • 0: failed

Exception

  • Exception

Documentation

  • Set opt-out status for the specified email contact.

Examples

public void setContactOptOutStatusSample() throws java.lang.Exception {

        Puresend p = new Puresend();
        PuresendPortType ppt = p.getPuresendHttpsSoap12Endpoint();

        String username = "XXX";
        String password = "XXX";
        long contactId = 123456789L;

        int result = ppt.setContactOptOutStatus(username, 
                                password, 
                                contactId,
                                false);
}
<?php
include 'puresend.php';

$p = new Puresend();

$setContactOptOutStatusData = new setContactOptOutStatus();
$setContactOptOutStatusData->username = 'XXX';
$setContactOptOutStatusData->password = 'XXX';
$setContactOptOutStatusData->contactId = 123456789;
$setContactOptOutStatusData->hasOptedOut = false;

$response = $p->setContactOptOutStatus($setContactOptOutStatusData);
var_dump($response);

?>