Skip to content

MailQueue->process(): message contained attachment cannot be unsearilzed #32

@earx

Description

@earx

yii mailqueue/process

PHP Notice 'yii\base\ErrorException' with message 'unserialize(): Error at offset 49151 of 49151 bytes'

in /app/vendor/nterms/yii2-mailqueue/models/Queue.php:70

have following code:

        $ret = Yii::$app->mailqueue->compose(
            '@app/views/mail/feedback_mail',
            [
                'appVersion'    => $data->browser->appVersion,
                'userAgent'	    => $data->browser->userAgent,
                'platform'	    => $data->browser->platform,
                'url'	        => $data->url,
                'note'	        => $data->note,
                'imagedata'	    => $data->img,
            ]
        )
        ->setFrom( Yii::$app->params['mail']['mailFromEmail'] )
        ->setTo( Yii::$app->params['mail']['feedbackEmail']  )
        ->setSubject('Site feedback')
        ->queue();

View:

<html>
    <body>
    <img src="<?= $message->embed($imagedata); ?>">
</body>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions