Integrating Swym Gift Lists and Registries with Omnisend

Created by Naga Priyanka, Modified on Fri, 28 Feb at 8:29 PM by Naga Priyanka

The Swym Gift Lists and Registries application can be seamlessly integrated with Omnisend using Shopify Flow. The following triggers are supported:

  1. Swym Registry Created – Activated when a shopper creates a new registry, enabling automated email notifications to the shopper upon registry creation.

  2. Swym Registry Order Created – Activated when a shopper (gifter) purchases a product from a registry, facilitating automated email notifications to the gifters.


Step-1: Creating Custom Events on Omnisend

  1. Under Store Settings > Custom Events, click on “Create Custom Event”



  2. Here is a sample curl that you can use to create the custom Events for Swym Gift lists and Registries Application


Swym Registry Created:

curl --location 'https://api.omnisend.com/v3/events' \

--header 'X-API-KEY: <<Your API key>>' \

--header 'accept: application/json' \

--header 'content-type: application/json' \

--data-raw '{

    "name": "Swym Registry Created",

    "systemName": "swymRegistryCreated",

    "email": "abc@gmail.com",

    "phone": "+12025550142",

    "fields": {

        "registryName": "Swym test",

        "shareableRegistryUrl": "https://mystore.myshopify.com/pages/swym-registry-gifter?registryId=2011082&emid=0e760f1e-bxd1-43d2-b201-e4d1c486e8df",

        "registrantEmail": "abc@gmail.com",

        "registryId": "2011082",

        "registrantName": "Swym Test",

        "coRegistrantName": "Name",

        "coRegistrantEmail": "abc@gmail.com",

        "registrantUrl": "https://mystore.myshopify.com/pages/swym-registry-owner?registryId=2011082",

        "registryDescription": "Congratulations! Good ",

        "registryEventDate": "2025-03-08"

    }

}'



Swym Registry Order Created:


curl --location 'https://api.omnisend.com/v3/events' \

--header 'Content-Type: application/json' \

--header 'X-API-KEY: <<Your API key>>' \

--data-raw '{

    "systemName": "swymRegistryOrderCreated",

        "email": "abc@gmail.com",

    "phone": "+12025550142",

  "contact": {

    "email": "{{order.email}}",

    "phone": "{{order.phone}}"

  },

  "name": "Swym Registry Created Order",

  "fields": {

    "shopDomain": "{{shop.domain}}",

    "orderId": "{{order.id}}",

    "customerFirstName": "{{order.customer.first_name}}",

    "customerLastName": "{{order.customer.last_name}}",

    "ThankYouNote": "{{order.note}}",

    "gifter": "{% for attr in order.customAttributes %}{% if attr.key == \"gifter\" %}{{ attr.value }}{% endif %}{% endfor %}",

    "gifterEmail": "{% for attr in order.customAttributes %}{% if attr.key == \"gifterEmail\" %}{{ attr.value }}{% endif %}{% endfor %}",

    "SwymGiftRegistry": "{% for attr in order.customAttributes %}{% if attr.key == \"SwymGiftRegistry\" %}{{ attr.value }}{% endif %}{% endfor %}",

    "swymDraftOrderId": "{% for attr in order.customAttributes %}{% if attr.key == \"swymDraftOrderId\" %}{{ attr.value }}{% endif %}{% endfor %}"

  }

}'


  1. Success response of the curl to create custom events would be “1”
    Here are the help documents to:
    -> Generate API key: https://support.omnisend.com/en/articles/1061890-generating-api-key
    -> Create Custom Events: https://support.omnisend.com/en/articles/1475482-custom-events


  1. Thereafter, you will be able to view the custom events. Keep the Event ID’s handy.



Step-2: Workflows on Shopify Flow


Swym Registry Created


  1. Click on “Create Workflow”


  1. Click on the “Swym Registry Created” trigger



  2. Under Trigger > Then > Action > Omnisend, click on “Track Event”



  3. Use the following variables for the fields:
    Customer Email Address: {{registrantEmail}}
    Customer First Name: {{registrantNamel}}
    Event custom fields:
    {

"registrantEmail": "{{registrantEmail}}",

"registryName": "{{registryName}}",

"registrantName": "{{registrantName}}",

"registryId":"{{registryId}}"

}

Event ID: Enter the ID of the custom Event



Swym Registry Order Created


  1. Click on “Create Workflow”



  2. Select the “Order Created” trigger



  3. Under trigger > Then > Condition, define a condition such that At least one of order / custom attributes equals SwymGiftRegistry



  4. Under Then > Action > Omnisend, select “Track Event”



  5. Use the following variables for the fields:
    Customer Email Address: {{order.email}}
    Customer phone number: {{order.phone}}
    Customer First Name: {{order.customer.firstName}}
    Customer Last Name: {{order.customer.lastName}}
    Customer Properties: {{order.confirmationNumber}}

Event ID: Enter the ID of the custom Event
Event custom fields: (Include as many event properties as you would like)

{

  "orderId": "{{order.id}}",

  "customerFirstName": "{{order.customer.firstName}}",

  "customerLastName": "{{order.customer.lastName}}",

  "ThankYouNote": "{{order.note}}",

  "gifter": "{% for attr in order.customAttributes %}{% if attr.key == 'gifter' %}{{ attr.value }}{% endif %}{% endfor %}",

  "gifterEmail": "{% for attr in order.customAttributes %}{% if attr.key == 'gifterEmail' %}{{ attr.value }}{% endif %}{% endfor %}",

  "SwymGiftRegistry": "{% for attr in order.customAttributes %}{% if attr.key == 'SwymGiftRegistry' %}{{ attr.value }}{% endif %}{% endfor %}",

  "swymDraftOrderId": "{% for attr in order.customAttributes %}{% if attr.key == 'swymDraftOrderId' %}{{ attr.value }}{% endif %}{% endfor %}",

  "Products": [

    {% for line_item in order.lineItems %}

      "{{ line_item.title }}"{% if forloop.last == false %}, {% endif %}

    {% endfor %}

  ]

}





Step-3: Triggering the workflows created on Shopify Flow

  1. Turn the workflows on after following the step-2

  2. To trigger the event Swym_registryCreated, create a new registry on the store

  3. To trigger the event Swym_registryOrderCreated, create an order by purchasing a product present on a registry

Triggering these workflows is essential to send the event payload to Omnisend 


Step-4: Creating email automations on Omnisend


Swym Registry Created:


  1. Click on “Create Automation”



  2. Click on “Create From Scratch”



  3. Select “Swym Registry Created” under triggers > API



  4. Add an email message



  5. Customise the email template as per your requirements. Below is a sample HTML:

<table style="width:100%; text-align:center;">

  <tr>

    <td style="font-size:18px; font-weight:bold; padding:10px;">Your Registry Details</td>

  </tr>

</table>


<p style="font-size:16px; margin:5px 0;"><strong>Name:</strong> [[event.registrantName]]</p>

<p style="font-size:16px; margin:5px 0;"><strong>Registry Name:</strong> [[event.registryName]]</p>

<p style="font-size:16px; margin:5px 0;"><strong>Registry ID:</strong> [[event.registryId]]</p>

<p style="font-size:16px; margin:5px 0;"><strong>Email:</strong> [[event.registrantEmail]]</p>


  1. Click on “Start workflow” to enable the email flow:




Swym Registry Order Created:


  1. Click on “Create Automation”



  2. Click on “Create From Scratch”



  3. Select “Swym Registry Order Created” under triggers > API



  4. Add an email message:



  5. Customise the email template as per your requirements. Below is a sample HTML:

    <table style="width:100%; text-align:center;">

      <tr>

        <td style="font-size:18px; font-weight:bold; padding:10px;">Your Registry Order Details</td>

      </tr>

    </table>

    <p style="font-size:16px; margin:5px 0;"> <strong>Thank you for placing an order from our registry!</strong>

    <p style="font-size:16px; margin:5px 0;"><strong>Name:</strong> [[event.gifter]]</p>

    <p style="font-size:16px; margin:5px 0;"><strong>Email:</strong> [[event.gifterEmail]]</p>

    <p style="font-size:16px; margin:5px 0;"><strong>Registry ID:</strong> [[event.SwymGiftRegistry]]</p>

    <p style="font-size:16px; margin:5px 0;"><strong>Note:</strong> [[event.ThankYouNote]]</p>

  6. Click on “Start workflow” to enable the email flow.


You have now successfully integrated Swym Gift Lists and Registries application with Omnisend! To verify the email flows, create a new registry and place an order by purchasing a product from the registry. In case you have further queries or require additional assistance, please reach out to us here - support@swymcorp.com.









Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article