sendgrid-php icon indicating copy to clipboard operation
sendgrid-php copied to clipboard

Feature Request: Support arbitrary data storage in Sendgrid\Mail

Open routinet opened this issue 9 months ago • 0 comments

In our application (Drupal 10, custom middleware module to leverage sendgrid-php library), we have a need to track meta-data regarding a proposed call to the Sendgrid API. Up to now, we have attached this data to the Sendgrid\Mail object as dynamic properties. As of PHP 8.2, this generates a deprecation warning (https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.dynamic-properties).

I'd like to modify Sendgrid\Mail to add a property for arbitrary data storage, with either:

  • new supporting methods (perhaps leveraging __set()/__get() ), or
  • a new dependency on Symfony's ParameterBag class

If this is a desired feature, which route would you prefer to take?

routinet avatar Mar 10 '25 21:03 routinet