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);
    }
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);
    }
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 ) ; }
Queues an email to be sent
@param string $type (SEND_BODY|SEND_TEMPLATE)
@param array $to
@param string $fromEmail
@param string $fromName
@param string $subject
@param null|string $body
@param string $contentType
@param null|string $template
@param array $parameters
@param array $cc
@param array $bcc
@param int $delaySeconds
@return string
Queues an email to be sent