With double opt-in, a new contact confirms their email address by clicking a link in a confirmation email. Send confirmation and welcome emails, confirm contacts directly, and add tasks that run when a contact confirms.
Get confirmation code
Returns the confirmation code of an unconfirmed contact. Returns an error if the contact is already confirmed.
If the contact has no code, create one with setRecipientNeedConfirmation.
Get confirmation code › Request Body
idContact ID.
Get confirmation code › Responses
OK
succeedResponse status.
resultContact confirmation code.
Create confirmation code
Creates a confirmation code for the contact and returns it. If the contact already has a code, that code is returned.
No email is sent. Confirm the contact with confirmRecipient.
Create confirmation code › Request Body
idContact ID.
Create confirmation code › Responses
OK
succeedResponse status.
resultContact confirmation code.
Confirm contact
Confirms the contact who has the given confirmation code and returns the contact ID, or 0 if the code is not found. A code can be used only once.
Actions that were waiting for the confirmation, such as list joins and consents given on a subscription page, are completed.
Confirm contact › Request Body
codeContact confirmation code.
reasonFree-text reason for the confirmation.
originOrigin of the confirmation, e.g. the subscription page URL.
Confirm contact › Responses
OK
succeedResponse status.
resultContact ID.
Send confirmation email
Sends an email with the given content to a contact, to ask them to confirm their subscription.
Works only if your account requires new contacts to confirm. Otherwise, the error Recipient doesn't need confirmation is returned. The email is sent whether or not the contact has already confirmed, so send it only to contacts that have not.
Send confirmation email › Request Body
recipient_idContact ID.
Send confirmation email › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Send welcome message
Sends the welcome message of the given site to a contact. The welcome message is set with setWelcomeDelivery, and an error is returned if the site has none.
With force set to 0, nothing is sent and 0 is returned if the contact has already received any mail.
Send welcome message › Request Body
recipient_idContact ID.
site_nameDomain name of the subscription site.
forceSet to 0 to skip sending if the contact has already received any mail. Defaults to 1.
propsProperty values for the message, as name-value pairs.
Send welcome message › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Add confirmation task
Adds a task to be run when the contact confirms: when the confirmation link in the welcome message is clicked or when confirmRecipient is called. Get the contact's confirmation code with getRecipientCode. Tasks are removed after 7 days, so a later confirmation does not run them.
Add confirmation task › Request Body
member_idContact ID.
confirmation_codeContact confirmation code.
task_typeConfirmation task type: consent adds a consent, membership joins a mailing list and properties sets contact properties.
Task data, applied when the contact confirms. Required keys depend on the task type.
Add confirmation task › Responses
OK
succeedResponse status.
resultReturns 1 on success.
Add confirmation tasks
Adds several tasks to be run when the contact confirms: when the confirmation link in the welcome message is clicked or when confirmRecipient is called. Works like addConfirmationTask, with the task type given in each task. The tasks are added one by one, so if one fails, the tasks before it are still saved.
Add confirmation tasks › Request Body
member_idContact ID.
confirmation_codeContact confirmation code.
Add confirmation tasks › Responses
OK
succeedResponse status.
resultReturns null.
Get confirmation tasks
Returns the tasks added with addConfirmationTask or addConfirmationTasks for a confirmation code. Returns an empty array if there are no tasks for the code.
Get confirmation tasks › Request Body
confirmation_codeContact confirmation code.
Get confirmation tasks › Responses
OK
succeedResponse status.