package Mail::SendGrid::SmtpApiHeader;
use strict;
use warnings;
use JSON;
our $VERSION = '0.02';
sub new {
my $class = shift;
return bless { 'data' => { } }, ref $class || $class;
}
sub ad
$JSON;
sub asJSON {
my $self = shift;
$JSON ||= _build_json();
return $JSON->encode($self->{data});
}
my $JSON_PRETTY;
sub asJSONPretty {
my $self = shift;
$JSON_PRETTY ||= _build_json()
(1);
return $JSON_PRETTY->encode($self->{data});
}
sub as_string {
my $self = shift;
my $json = $self->asJSON;
$json =~ s/(.{1,72})(\s)/$1\n /g;
my $str = "X-SMTPAPI: $json";
return $s