type == "order.payment_succeeded") { $customer = \Stripe\Customer::retrieve($event->data->object->customer); $email = $customer->email; $amount = sprintf('$%0.2f', $event->data->object->amount_due / 100.0); } curl -sS https://getcomposer.org/installer | php php composer.phar require mailgun/mailgun-php php-http/guzzle6-adapter php-http/message require 'vendor/autoload.php'; use Mailgun\Mailgun; $mgClient = new Mailgun('key-5645b1f9-a3c3474b'); $domain = "gifts.davidkind.com"; $result = $mgClient->sendMessage($domain, [ 'from' => 'David Kind Support ', 'to' => $email, 'subject' => 'Thank you for your gift card order!', 'text' => 'Hi there, Thank you for placing your gift card order for ' . $amount . '. We will be in touch shortly to confirm your order and any messaging you'd like to send your recipient. In the meantime, if you have any questions, please reply to this email or call us during business hours at 800-995-2032. Thank you!' ]);