in reply to Encountered object '5.03 ', but neither allow_blessed nor convert_blessed settings are enabled
I'm getting a very similar error...
my $payload = { 'sender' => { 'name' => $vars{'fromname'}, 'email' => $vars{'frommail'}, }, 'to' => [{ 'name' => $vars{'name'}, 'email' => $vars{'email'}, }], 'subject' => $vars{'subject'}, 'HTMLcontent' => $body, }; $payload->{'textContent'} = $vars{'preview'} if $vars{'preview'}; my $attrs = { 'headers' => $headers, 'content' => encode_json $payload, };
This is part of the email module we use to send emails through Brevo. But I'm seeing an error...
encountered object 'Site::Email=HASH(0x55fa0a139c18)', but neither all +ow_blessed, convert_blessed nor allow_tags settings are enabled (or T +O_JSON/FREEZE method missing)
The error line is encode_json.
The weird part is that nearly identical code is running elsewhere on the same server without a problem! It's been suggested that bignum could affect it but we are not using that module in either place.
I'm aware of this bug report but that wouldn't explain why one place fails and another doesn't.
Dumpling $payload gives the result one would expect - any ideas on how I further debug this issue?
This is Perl v5.36 on Debian 12
UPDATE...
The problem turned out to be the way I was calling the module...and using the same variable twice!
my $email = Site::Email->new; my $resp = $email->send( 'fname' => $fname, 'user' => "$prefix$data{'idCRM'}", 'token' => $token, 'template' => 'newuser', 'name' => $to, 'email' => $email, 'subject' => 'Your Book Boost Account...' );
|
---|