Execute an email account intent
Start creating the intent’s mailbox at the email provider now and answer outcome: STARTED at once: the provider takes up to a minute, then Primo links the mailbox to its task and to the ticket holding it and completes the task. Follow the task with getTicket on the intent’s taskId: it turns COMPLETED once the mailbox exists, and stays PENDING with an internal comment when the provider refuses. Rarely needed: the mailbox is created on its own when the task is created without a date or wakes up on its date. Use it to retry after a refusal left the task PENDING with a comment. This is the only way to complete an EMAIL_ACCOUNT task: updateTaskStatus refuses it with TaskLockedByTypeError naming this operation. Safe to retry: an intent executed earlier answers outcome: ALREADY_EXECUTED and creates nothing again, and a call while the mailbox is being created is refused with EXECUTION_IN_PROGRESS. Refused at once with TICKET_SCHEDULED before a scheduled task wakes up, TICKET_CLOSED, EXECUTION_IN_PROGRESS, EMAIL_ACCOUNT_ALREADY_EXISTS (the employee already has an account at an address other than the one to create); a refusal leaves the task PENDING with an internal comment on the ticket. When the provider refuses after STARTED (EMAIL_ACCOUNT_NOT_CREATED, COMPANY_SAAS_APPLICATION_NOT_CAPABLE), the task stays PENDING with that internal comment. For an onboarding still on the classic email step, the step is handled by the onboarding itself; this intent is the email work tracked as a task on a ticket (an EMAIL_ACCOUNT task), and never closes an onboarding email step.
Authorizations
Response
STARTED: Primo is creating the mailbox, the task completes when it is done (follow the task with getTicket on taskId); EXECUTED: the mailbox existed, its task was completed; ALREADY_EXECUTED: an earlier call or the wake-up created the mailbox — nothing was created again
STARTED, EXECUTED, ALREADY_EXECUTED