Structure Templates How-to
~ 9 min read
3018 views
rate it
30 September

Introduction to the Stripo Mock Server

Stripo / Blog / Introduction to the Stripo Mock Server

This September, we released our Mock Server. It is there to enable every email marketer to build end-points* on their own for checking if their AMP emails are capable of dealing with servers and of sending/receiving data, and to save time on email production.

*End-point is a destination on a server where requests are delivered to for further processing, and it is also meant for exchanging data. The end-point is often represented by a link.

Mock is actually a fake object that acts like real data.

What is it meant for? With our mock server, any email marketer can start designing AMP emails right away without the necessity to wait for developers to provide them with end-points from real servers.

You build and add mock end-points to AMP components in emails to figure out what data you want to get from / send to servers. 

When you make sure that this AMP email with our mock end-points is exactly what you need, you can now send it to developers and ask them to build real end-points similar to the mock ones that you’ve built with us.

This significantly saves time on building AMP emails and allows assigning clear and certain tasks to developers.

What emails require end-points

You will need the mock server for building complex AMP emails. By a complex AMP email, we mean the emails that do communicate with your servers — they either send, or receive information.

These are forms, questionnaires, digests, “time-ago” components, i.e. all info that gets updated in emails automatically or is sent to servers for further processing.

Though, you do not need Mock servers for simple AMP emails. The simple AMP emails are the ones that do not communicate with your servers.  

These are accordion, image carousel, lightbox effect, selector (where you pick sizes, colors, stuffing), etc. 

You can build them with Stripo with literally no coding skills.

Benefits of using our Mock server:

  1. You build end-points on your own with our help. You do not need deep coding skills. 
  2. Though, it is you who defines the set of required input and output parameters.  
  3. You check if your AMP emails that need to post or receive information from servers work well and everything is set correctly. You do it prior to implementing end-points on your side.
  4. You can even view data gathered from your email templates.
    FYI: gathered data is stored on our servers for only 30 minutes.
  5. You can assign clear and definite tasks to developers. Without this mock code, it could be somewhat difficult to explain to them what exactly you need and how your emails are supposed to interact with servers and process data.

How does it work?

It will take you just three steps to build fake end-points and check if your AMP emails are capable of dealing with servers and if everything is set correctly.

1. Creating end-points

 Creating end-points with Stripo will not take you long:

Creating End-Points End

To start working with our Mock server, you need to:

  • expand the “Read and Create End-Points” section in our accordion;

Mock Server_Main Page

  • select “Get” or “Post” tab in it. I choose “post” as I am building a totally new end-point;

Get or Post Methods

Important to note:

When entering the “Get” tab, you can see what end-points you’ve used before. You group them into sections by names and categories. 

When entering the “Post” tab, you build a totally new end-point.

  • click the “Try it out” button;

Try It Out Button_Mock Server

  • in a new window, give names to “Endpoint” and “group”. We recommend giving clear and easy names as you will need them later for checking the data which you receive from end-points;

Working on EndPoin Code

Important to note:

Choose the “Get” methodType when you want to return data from server to emails. It is meant for digests, product updates, like quantity, new prices, etc.

Choose the “Post” methodType when you need to send data from emails to servers. It is meant for feedback, forms, questionnaires, etc.

  • now, if you want just to thank your customers for sharing their feedback, remove the “response” section till “response status”;

Removing Superfluous Elements of Your Emails

Important to know:

You will need the removed part of the code to provide recipients with, say, promo codes or any other additional information that depends on their activity and requires using variables.

But we do not do it now as we are not going to offer promo codes to our recipients for sharing feedback.

  • “responseStatus”: 200 means that your end-point has been built correctly and can be used in your emails. Once you generate the mock code, and if it’s been built correctly, you will see this mark 200;
  • so, my mock code looks as shown below;
  • click the “Execute” button to generate your end-point;

The Execute Button

  • in the new window below, please find the “Code” —> “Response Body” section;
  • to the left, we see mark “200” — this means our code has been generated correctly;
  • copy the end-point, which is located in quotes. The end-point is actually a link to the server where responses will be sent to;

The Embed Code

Important to note:

The curl section is meant for developers only. We strongly recommend that you do not work with it.

2. Adding this end-point in your AMP email

No matter if you use AMP email templates that Stripo offers, or use components that Google offers and embed them in Stripo email templates, the algorithm of adding end-points remains the same if you are building AMP email with Stripo.

I used the following template for the test.

AMP Email Template with Survey

Use this template

This template enables recipients to rate products and leave comments.

Adding endpoints in emails:

Pasting End-Point in Email

So, to add your end-point to an email template, you need to:

  • click this AMP element in your email template to activate settings of this certain component. The code editor will get open, and it will show you the code of this particular element;
  • replace the default end-point with the end-point that you’ve just generated;

Replacing default end-point with Necessary One

  • preview your email. If there is any mistake, or a missing URL in your AMP email, our code validator will show it to you;

Mistakes-in-AMP-Version-of-Your-Emails

  • be sure to insert links to all images in your emails including social media icons.

Please remember that if your AMP email contains any error and your template does not pass our AMP validator, recipients will see the traditional HTML version of this email.

3. Checking if your end-points work well

To check if your end-points work correctly in emails, we strongly recommend that you send this email to your email address instead of testing it in the “preview mode” in our email builder.

Important to note:

You need to add "info@stripo-test.email" in your Gmail account as a trusted sender.

For more information on how to do it, please refer to our dedicated blog post, section How to test AMP emails with Stripo

  • to send a test email, click the “Test” icon;

Testing AMP emails_The Test Icon

  • enter your email address. You may also enter your colleagues’ email addresses. When entering them, put commas between addresses;

Entering Email Addresses_Testing AMP Emails

  • open this email in your Inbox;

Please be advised that only registered users can send test emails.

Get registered with Stripo

  • rate your product items and leave any comment, click “send feedback”;
  • you will see “Thank you for your opinion”;

Submitting Feedbacks

  • now that our feedback is sent, we need to go back to our mock server to see if the results were received;

    Checking Data Received From EndPoints

  • click the “Check data from end-points” and “Get”
  • press the “try it out” button;

Checking Data on Our Mock Servers

  • enter the name of your end-point — in our case, it is “feedback”;
  • enter the name of your group — we named it “ampemails”;
  • click the “execute” button;

Entering End-Point and Group Names

  • once you click this button, your report gets generated. Scroll down to see it;
  • in the “Request URL” field, you will find the duplicated end-point. It is meant to let you make sure that you entered correct names for checking the received data;
  • the mark “200” means that your end-point worked well;
  • in the “Response body” section, you will find the answers your users gave to you — you see rates and feedbacks.

Viewing Results of Feedbacks

Important to mention:

I want to repeat myself — all the data/responses are stored on our Servers for only 30 minutes. We believe that 30 minutes are quite enough to make sure that everything was built and set correctly and the server receives necessary information.

If you see the answers, it means you did everything well.

Please be advised that your server will also have to meet the CORS requirements. Developers will do it in no time.

Why do you need the “Test created end-points” section in our Mock Server?

It is meant to let you test your end-points within our servers without pasting and trying them out in real emails. You check if your end-points send and receive the set input and output parameters correctly.

To test your end-points, you need to:

  • enter this section;
  • choose the necessary method — we choose “POST”;
  • click the “Try it out” button;
  • enter the end-point and group’s names in respective fields;

Testing Emails with Mock Server

  • click “execute”;
  • in the “Server response” section, see the status of your requests to the server — if it shows “200”, then you may rest assured — everything has been done right, and you may now start building real end-points on your server.

Final words

Our mock server is meant to help email marketers and email coders build endpoints for testing purposes.

Embed the endpoints that you build with us in your AMP email templates to see how the latter communicate with servers.

If you have some questions left on how to work with our mock server, please leave a comment below or email our tech team at support@stripo.email.

We will be happy to assist.

Use Stripo

Be always wide awake in recent email marketing news, guides, articles and how-to’s