• Hello!

    I need to add a script which sends a follow up email to the customers after purchase.

    Here’s the code that I need to add:

    require_once 'TrustedShop.php';
    
    try {
    
      // Provide your own WebAPI key.
      // You can find your WebAPI key on your partner portal.
    
      $Client = new TrustedShop('0000000000000000');
    
      // Provide the e-mail address of your customer.
      // You can retrieve the e-amil address from the webshop engine.
    
      $Client->SetEmail('somebody@example.com');
    
      // Provide the name of the purchased products.
      // You can get the name of the products from the webshop engine.
      // The AddProduct method must be called for each of the purchased products.
      //
      // It is optional to provide the name of the products, so if this data is not
      // available, you can leave out the AddProduct calls.
    
      $Client->AddProduct('Name of first purchased product');
      $Client->AddProduct('Name of second purchased product');
    
      // This method sends us the e-mail address and the name of the purchased
      // products set above. After the data arrived to us, we store them
      // with the time stamp and the WebAPI key.
      // This lets us know that someone has purchased at your webshop, to whom
      // we later have to send the questionnaire for evaluating your shop.
      // The "Send()" operation doesn't send immediately. It generates a HTML output,
      // puts into source of the page and the customer's browser will send the
      // required informations us.
    
      $Client->Send();
    
    } catch (Exception $Ex) {
    
      // Here you can implement error handling. The error message can be obtained
      // in the manner shown below. Implementing error handling is optional.
    
      $ErrorMessage = $Ex->getMessage();
    }

    Any ideas where should I put this code and how to modify it so that I have the customers email address and ordered items names?

    I guess that thankyou.php may be the file, but I don’t know what to do with the code…

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Retrieve customer email and oredered items after purchase’ is closed to new replies.