I have a script that fetches some data from GA and updates a few entries in my database. It's in a cron and runs every morning. It typically takes about 2.5-3 hours to run. Post completion, I am sending an email to a few people on the team. The contents of this email are similar to: "name of the cron: ran successfully". I am using Laravel (5.6) mailables and multiple scripts use the same method to send a completion mail in the same way. The body of email is sent as an HTML string through data (using with() in build() method of mailable I created). Mails are queued on Amazon SQS. None of the other scripts are producing this error. Here is some excerpt from the error I get in console:
<?xml version="1.0"?>
<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2
012-11-05/"><Error><Type>Sender</Type><Code>I (truncated...)
InvalidParameterValue (client): One or more parameters are invalid. Reason
: Message must be shorter than 262144 bytes. - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<Error>
<Type>Sender</Type>
<Code>InvalidParameterValue</Code>
<Message>One or more parameters are invalid. Reason: Message must be shorter than 262144 bytes.
</Message>
<Detail/>
</Error>
<RequestId>d1a6b7ca-33b4-54ca-bf23-e38d3228e1d6</RequestId>
</ErrorResponse>
There are no attachments or images in this email. I am wondering how a plain text email can exceed the limit of 256 KB. Any ideas?
Update: My bad. There is one more email that is sent via this script. It's sent to users of the website. It doesn't have any attachments, but a few logos (< 15 KB in total). Rest is plain text and links. It is sent to multiple users throughout the course, but the error is not thrown immediately, so it's not happening on every email. I have tried simulating both mails through tinker and it has worked. I was not serializing the data in the users' mail. Could that be the issue?