public function queueEmail(
        $type,
        $to,
        $fromEmail,
        $fromName,
        $subject,
        $body = null,
        $contentType = 'text/html',
        $template = null,
        $parameters = [],
        $cc = [],
        $bcc = [],
        $delaySeconds = 0
    ) {
        $payload = [
            'to' => $to,
            'fromName' => $fromName,
            'fromEmail' => $fromEmail,
            'subject' => $subject,
            'cc' => $cc,
            'bcc' => $bcc,
        ];

        if ($type === self::SEND_TEMPLATE) {
            $method = 'performSendTemplate';
            $payload['template'] = $template;
            $payload['parameters'] = $parameters;
        } else {
            $method = 'performSend';
            $payload['body'] = $body;
            $payload['contentType'] = $contentType;
        }

        return $this->addJob('email', $payload, self::class, $delaySeconds, $method);
    }