digitalwithyou / craft-facebook-conversion

Craft CMS plugin to send web events directly to Facebook
https://digitalwithyou.com/en/plugins/facebook-conversion/getting-started
Other
0 stars 3 forks source link

The getEmail() method is no longer available for the order customer as it returns a native craft User? #36

Open samhibberd opened 1 year ago

samhibberd commented 1 year ago

See:

https://github.com/digitalwithyou/craft-facebook-conversion/blob/9df234c090b4bce1f248b0f8f9f2b5b395a0cc53/src/listeners/commerce/BaseCommerceEvent.php#L43

Results in an Unknown Method exception:

{
    "name": "Exception",
    "message": "Calling unknown method: craft\\elements\\User::getEmail()",
    ...
}

To fix, replace getEmail() with email: $email = $customer->email;