sendgrid-perl
sendgrid-perl copied to clipboard
Suggested improvement to documentation
I just spent a little time figuring out how to do what SendGrid calls "substitutions", which isn't in the POD.
If you put template objects into your 'html' value in the call to new(), they can be replaced with variables at the time of sending, e.g.:
my $sg = Email::SendGrid->new(
## other stuff
html => '<a href="-SomeWebsite-">click here</a>'
);
then you use the addSubVal method to specify the replacement content.
$sg->header->addSubVal( '-SomeWebsite-' => 'http://google.com' );
and the tag will be replaced in the rendered email sent:
<a href="http://google.com">click here</a>
I suggest you add this to the documentation.