Difference between revisions of "Setting up Yotpo Mail After Purchase"
From Spiffy Stores Knowledge Base
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | 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 | + | 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 email customers automatically after they make a purchase, rather than emailing your customers manually or using a service like MailChimp to email your customers. |
− | + | Most stores currently have no way of collecting reviews automatically. Yotpo's free service allows you to automatically email your customer after they've made a purchase prompting them to review your store or the product. The reviews can then either display in your store automatically, or you can use Yotpo's built-in moderation to approve reviews before they are displayed. | |
− | # The email address and password you use to log in to Yotpo. They need to be for the | + | The setup cost of the Yotpo Mail After Purchase function is a one-off fee of $35 AUD. To have us set it up for you, please [mailto:support@spiffystores.com.au?subject=Please%20add%20the%20Yotpo%20Mail%20After%20Purchase%20function%20to%20my%20store&body=Hi%2C%0D%0A%0D%0AI%20would%20like%20the%20Yotpo%20Mail%20After%20Purchase%20function%20added%20to%20my%20store.%0D%0A%0D%0AMy%20store%20name%3A%0D%0A%0D%0AYotpo%20login%20email%3A%0D%0AYotpo%20Password%3A%0D%0A%0D%0AApp%20Key%3A%0D%0ASecret%20Key%3A%0D%0A%0D%0AI%20agree%20to%20the%20%2435%20AUD%20charge%20to%20add%20the%20function%20to%20my%20store.%0D%0A%0D%0AThank%20you%2C%0D%0AYour%20name email us] with the following information... |
+ | |||
+ | # The email address and password you use to log in to Yotpo. They need to be for the administrator of the Yotpo account, as we cannot generate keys without admin access.<br><br> | ||
# Your Yotpo App Key and Secret Key<br><br> | # Your Yotpo App Key and Secret Key<br><br> | ||
− | # Your | + | # Your store's name<br><br> |
== Retrieving your Yotpo App Key and Secret Key == | == Retrieving your Yotpo App Key and Secret Key == | ||
− | App Key | + | App Key<br> |
# Log in to your Yotpo Dashboard | # Log in to your Yotpo Dashboard | ||
# Hover over the person icon in the top right, and click "Settings". | # Hover over the person icon in the top right, and click "Settings". | ||
# Scroll down to the bottom of the page and copy your APP Key | # Scroll down to the bottom of the page and copy your APP Key | ||
− | # Paste your App Key into the email you send us. | + | # Paste your App Key into the email you send us. <br><br> |
− | Secret Key | + | Secret Key<br> |
# To retrieve your secret key, you'll need to click the "Get Secret Key" button. | # To retrieve your secret key, you'll need to click the "Get Secret Key" button. | ||
− | # A link will be sent to you with a code | + | # A link will be sent to you by email with a code. |
− | # | + | # Paste the code from the email into the "Enter the code" box. |
# Your Secret key will now be displayed. | # Your Secret key will now be displayed. | ||
− | # Paste your Secret Key into the email you send us. <br> | + | # Paste your Secret Key into the email you send us. <br><br> |
− | When you have all the info we need, please [ mailto:support@spiffystores.com.au email us ] with this info, and request that we add the conversion code to your store for you | + | When you have all the info we need, please [mailto:support@spiffystores.com.au?subject=Please%20add%20the%20Yotpo%20Mail%20After%20Purchase%20function%20to%20my%20store&body=Hi%2C%0D%0A%0D%0AI%20would%20like%20the%20Yotpo%20Mail%20After%20Purchase%20function%20added%20to%20my%20store.%0D%0A%0D%0AMy%20store%20name%3A%0D%0A%0D%0AYotpo%20login%20email%3A%0D%0AYotpo%20Password%3A%0D%0A%0D%0AApp%20Key%3A%0D%0ASecret%20Key%3A%0D%0A%0D%0AI%20agree%20to%20the%20%2435%20AUD%20charge%20to%20add%20the%20function%20to%20my%20store.%0D%0A%0D%0AThank%20you%2C%0D%0AYour%20name email us] with this info, and request that we add the conversion code to your store for you.<br><br> |
=Want to do it yourself?= | =Want to do it yourself?= | ||
To send order data to Yotpo, you'll need to generate a user token (UTOKEN). Yotpo documentation on how to do this can be found at https://core-api.yotpo.com/v1.0/reference#about-authentication | To send order data to Yotpo, you'll need to generate a user token (UTOKEN). Yotpo documentation on how to do this can be found at https://core-api.yotpo.com/v1.0/reference#about-authentication | ||
− | Once you have your user token, copy the code snippet below, and paste it into the " | + | A handy utility to do this is the [https://www.postman.com/ Postman App]. |
+ | |||
+ | Once you have your user token, copy the code snippet below, and paste it into the "Additional Content & Scripts" field in the Preferences -> Checkout & Payment section of your store's admin. You'll need to update the <APPKEY> and <UTOKEN> in the code with your Yotpo App Key and your Yotpo User Token.<br><br> | ||
+ | |||
+ | One note about this DIY solution though... the UTOKEN lasts only 14 days, so you would need to update it every 14 days to keep it running.<br><br> | ||
<pre> | <pre> | ||
− | <! -- Yotpo mail after purchase --> | + | <!-- Yotpo mail after purchase --> |
<script> | <script> | ||
Line 37: | Line 43: | ||
var data = JSON.stringify({ | var data = JSON.stringify({ | ||
"platform": "general", | "platform": "general", | ||
− | "utoken": " | + | "utoken": "<UTOKEN>", |
"email": "{{ customer.email }}", | "email": "{{ customer.email }}", | ||
"customer_name": "{{ customer.first_name }}", | "customer_name": "{{ customer.first_name }}", | ||
Line 54: | Line 60: | ||
var xhr = new XMLHttpRequest(); | var xhr = new XMLHttpRequest(); | ||
− | var url = "https://api.yotpo.com/apps/ | + | var url = "https://api.yotpo.com/apps/<APPKEY>/purchases/"; |
xhr.open("POST", url, true); | xhr.open("POST", url, true); | ||
xhr.setRequestHeader("Content-Type", "application/json"); | xhr.setRequestHeader("Content-Type", "application/json"); | ||
Line 69: | Line 75: | ||
</script> | </script> | ||
− | <! -- End Yotpo mail after purchase --> | + | <!-- End Yotpo mail after purchase --> |
</pre> | </pre> | ||
+ | |||
+ | <br><br> |
Latest revision as of 09:30, 13 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 email customers automatically after they make a purchase, rather than emailing your customers manually or using a service like MailChimp to email your customers.
Most stores currently have no way of collecting reviews automatically. Yotpo's free service allows you to automatically email your customer after they've made a purchase prompting them to review your store or the product. The reviews can then either display in your store automatically, or you can use Yotpo's built-in moderation to approve reviews before they are displayed.
The setup cost of the Yotpo Mail After Purchase function is a one-off fee of $35 AUD. To have us set it up for you, please email us with the following information...
- The email address and password you use to log in to Yotpo. They need to be for the administrator of the Yotpo account, as we cannot generate keys without admin access.
- Your Yotpo App Key and Secret Key
- Your store's name
Retrieving your Yotpo App Key and Secret Key
App Key
- Log in to your Yotpo Dashboard
- Hover over the person icon in the top right, and click "Settings".
- Scroll down to the bottom of the page and copy your APP Key
- Paste your App Key into the email you send us.
Secret Key
- To retrieve your secret key, you'll need to click the "Get Secret Key" button.
- A link will be sent to you by email with a code.
- Paste the code from the email into the "Enter the code" box.
- Your Secret key will now be displayed.
- Paste your Secret Key into the email you send us.
When you have all the info we need, please email us with this info, and request that we add the conversion code to your store for you.
Want to do it yourself?
To send order data to Yotpo, you'll need to generate a user token (UTOKEN). Yotpo documentation on how to do this can be found at https://core-api.yotpo.com/v1.0/reference#about-authentication
A handy utility to do this is the Postman App.
Once you have your user token, copy the code snippet below, and paste it into the "Additional Content & Scripts" field in the Preferences -> Checkout & Payment section of your store's admin. You'll need to update the <APPKEY> and <UTOKEN> in the code with your Yotpo App Key and your Yotpo User Token.
One note about this DIY solution though... the UTOKEN lasts only 14 days, so you would need to update it every 14 days to keep it running.
<!-- Yotpo mail after purchase --> <script> $(document).ready(function(){ var data = JSON.stringify({ "platform": "general", "utoken": "<UTOKEN>", "email": "{{ customer.email }}", "customer_name": "{{ customer.first_name }}", "order_id": "{{ order_name }}", "order_date": "{{ order_date | date: "%Y-%m-%d" }}", "currency_iso": "{{ shop.currency }}", "products": {% for item in line_items %}{ "{{ item.sku }}": { "url": "{{ item.product.url }}", "name": "{{ item.title }}", "image": "{{ item | img_url: '2048x2048' }}", "price": "{{ item.price | money_without_currency }}" }{% unless forloop.last %},{% endunless %}{% endfor %} } }); var xhr = new XMLHttpRequest(); var url = "https://api.yotpo.com/apps/<APPKEY>/purchases/"; xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { var json = JSON.parse(xhr.responseText); console.log(json); } }; xhr.send(data); }); </script> <!-- End Yotpo mail after purchase -->