All Collections
Plugin Questions
Helpers
(Plugin) Update timer links in the cloned email template
(Plugin) Update timer links in the cloned email template

In this article, you will find the guide on how to update timer links in the cloned email template

Alina avatar
Written by Alina
Updated over a week ago

The timer block is one of the important tools that displays a countdown to a specific event or deadline. Its main purpose is to create urgency and anticipation by showing how much time is left until the event or offer begins. When the countdown reaches zero, it signifies the start of the event or the end of the deadline. This feature helps maintain user interest and encourages action.

Within Stripo, the timer block is accessible across various tariff plans. While premium users enjoy extensive options, the free version remarkably offers up to a thousand views monthly, catering well to beginners.

For the most reliable and up-to-date details regarding tariff plans, simply navigate to the pricing plan page.

However, one common issue encountered when copying templates in the Stripo Plugin containing timers is synchronization problems. For example, there is a template A that contains a timer. When you copy template A and thus create template B, template B will have the same timer URL as template A.

To circumvent this issue and ensure seamless functionality, a special method is employed when copying templates. This method generates a new link for each timer in the copied template, thereby eliminating synchronization conflicts.

Resolution Method:

When copying email templates outside the Stripo editor, the following method should be implemented:

  • You need to call this method in case of copying email templates outside Stripo editor:

POST: /api/v1/timers/clone
Host: https://plugins.stripo.email
Content-Type: application/json
Header: ES-PLUGIN-AUTH: Bearer YOUR_AUTH_TOKEN
Accept: application/json
Body: {html:HTML_CODE_WITH_TIMER_LINKS}
Response: {html:HTML_CODE_WITH_UPDATED_TIMER_LINKS, timersMap: {oldTimerId_1:` {newTimerId_1: newTimerUrl_1}, {oldTimerId_2:` {newTimerId_2: newTimerUrl_2}, …}
  • Request params:

“html” - “dirty” html code of cloned email template that was saved in the database. This HTML is returned with window.getTemplate() inside editor or received by your endpoint in case of autosave enabled.

  • Response params:

"html" - "dirty" html code with replaced timers links. Original HTML in the database should be replaced with this one.

"timersMap" - info about timers that were cloned. You can see how many timer's links were cloned with this info.

Example:

Request:
curl -X POST https://plugins.stripo.email/api/v1/auth -k -H "Content-Type: application/json" -H "Accept: application/json" --data "{\"pluginId\":\"YOUR_PLUGIN_ID\",\"secretKey\":\"YOUR_SECRET_KEY\"}" -i

Response:
{"token":"YOUR_AUTH_TOKEN"}

Request:
curl --location --request POST 'https://plugins.stripo.email/api/v1/timers/clone' \
--header 'Content-Type: application/json' \
--header 'ES-PLUGIN-AUTH: Bearer AUTH_TOKEN' \
--data-raw "{\"html\":\"DIRTY_HTML_CODE_WITH_TIMER_LINKS\"}"

Response:
{
"html": "DIRTY_HTML_CODE_WITH_UPDATED_TIMER_LINKS",
"timersMap": {
"123": {
"124": "https://new_timer_124_link"
},
"234": {
"345": "https://new_timer_345_link"
}
}
}

For more details, please refer to our comprehensive API documentation.

By adhering to this method, you can effectively manage and update timer links, ensuring seamless functionality across duplicated templates.


Thank you for taking the time to read our articles. We hope you will find this information helpful.


If you have any additional questions, please email us at support@stripo.email.

We would be glad to talk with you.


Did this answer your question?