Difference between revisions of "Setting up Yotpo Mail After Purchase"

From Spiffy Stores Knowledge Base

Line 18: Line 18:
  
 
<html>
 
<html>
<form>
+
<form id="utoken" action="https://api.yotpo.com/oauth/token" method="post">
<label for="yotpo-app-key">App Key</label>
+
<label for="client_id">App Key</label>
<input type="text" id="yotpo-app-key" required>
+
<input type="text" id="client_id" required>
<label for="yotpo-secret-key">Secret Key</label>
+
<label for="client_secret">Secret Key</label>
<input type="text" id="yotpo-secret-key" required>
+
<input type="text" id="client_secret" required>
 +
<input type="hidden" id="grant_type" value="client_credentials">
 
<button type="submit">Submit</button>
 
<button type="submit">Submit</button>
 
</form>
 
</form>
 +
 +
<script>
 +
var form= ;
 +
 +
form.onsubmit = function (e) {
 +
  // stop the regular form submission
 +
  e.preventDefault();
 +
 +
  // collect the form data while iterating over the inputs
 +
  var data = {};
 +
  var Appkey =
 +
  for (var i = 0, ii = form.length; i < ii; ++i) {
 +
    var input = form[i];
 +
    if (input.name) {
 +
      data[input.name] = input.value;
 +
    }
 +
  }
 +
 +
  // construct an HTTP request
 +
  var xhr = new XMLHttpRequest();
 +
  xhr.open(form.method, form.action, true);
 +
  xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
 +
 +
  // send the collected data as JSON
 +
  xhr.send(JSON.stringify(data));
 +
 +
  xhr.onloadend = function () {
 +
    // done
 +
  };
 +
};
 +
 +
</script>
 
</html>
 
</html>

Revision as of 12:51, 12 May 2021

If you've already added the Yotpo Reviews Widget, you now have the option of adding the Mail After Purchase function. This process takes a few steps, but the benefit from this is that you can collect reviews to display in your store automatically, rather than emailing your customers manually or using a service like MailChimp to email your customers.

Step 1 - Retrieve your Yotpo App Key and Secret Key

App Key

  1. Log in to your Yotpo Dashboard
  2. Hover over the person icon in the top right, and click "Settings".
  3. Scroll down to the bottom of the page and copy your APP Key
  4. Paste your App Key into the "App Key" field below.

Secret Key

  1. To retrieve your secret key, you'll need to click the "Get Secret Key" button.
  2. A link will be sent to you with a code
  3. Paster the code from the email into the "Enter the code" box
  4. Your Secret key will now be displayed, and you should paste it into the "Secret Key" field below.

When you have both of these fields filled, submit the form below.