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.
You can build them with Stripo with literally no coding skills.
Benefits of using our Mock server:
- You build end-points on your own with our help. You do not need deep coding skills.
- Though, it is you who defines the set of required input and output parameters.
- 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.
- You can even view data gathered from your email templates.
FYI: gathered data is stored on our servers for only 30 minutes.
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:
To start working with our Mock server, you need to:
- expand the “Read and Create End-Points” section in our accordion;
- select “Get” or “Post” tab in it. I choose “post” as I am building a totally new end-point;
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;
- 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;
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”;
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;
- 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;
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.
This template enables recipients to rate products and leave comments.
Adding endpoints in emails:
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;
- preview your email. If there is any mistake, or a missing URL in your AMP email, our code validator will show it to you;
- 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 "email@example.com" 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;
- enter your email address. You may also enter your colleagues’ email addresses. When entering them, put commas between addresses;
- open this email in your Inbox;
Please be advised that only registered users can send test emails.
- rate your product items and leave any comment, click “send feedback”;
- you will see “Thank you for your opinion”;
- now that our feedback is sent, we need to go back to our mock server to see if the results were received;
- click the “Check data from end-points” and “Get”
- press the “try it out” button;
- 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;
- 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.
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;
- 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.
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 firstname.lastname@example.org.
We will be happy to assist.