Different versions of the module will use different paths for the main include. This means you can continue to use the older module code on existing sites, or upgrade to use the new tag. If the 3rd party tool we are integrating with stops supporting that version of their API, we cannot guarantee older versions will continue to work as before.
Initial release
The Sendgrid CRM Sync Module aims to integrate the Siteglide CRM with an Email Marketing Platform, starting with Sendgrid.
The module can carry out the following actions taking the data from the Siteglide Admin and using it to update the e-marketing platform's data:
Creating custom fields automatically
Renaming custom fields if the name has been changed in Siteglide
Creating a Contact with CRM data
Updating a Contact
Adding a Contact to Lists
Removing a Contact from Lists
Deleting a Contact
It's also possible to use Liquid logic and parameters to modify which of these actions is taken at any one time.
At the present time, the module does not make use of webhooks to update Siteglide when something changes on the e-marketing provider. Any checks on the current state of data on the e-marketing provider are done when the module code is run by Siteglide.
The module is not intended at the current time to allow design and triggering of bulk emails from the Siteglide Admin itself. Instead, by syncing data to an e-marketing platform, it allows you to make the most of the no-code and low-code tools on that platform, powered by automated, up-to-date, data. Sendgrid for example allows automations to be triggered a certain amount of time after a contact is added to a specific list. The module's job is to add that contact to the list, Sendgrid then has everything it needs to run a wide range of automations.
The module is designed to require minimal code to set up- for many use cases, you only need to add a single line of code.
The first thing you will need to do to use this module is create an account with an e-marketing provider. For now, we only support Sendgrid, but please let us know if you have a feature request to support another. Please follow Sendgrid's own support for help getting this set up.
Once you're logged in, you need to create an API key.
The API key can be added to the module in the Siteglide Admin:
You're now ready to add some simple code.
It is probably simplest to choose Custom Action as the Automation type, or you could add the code on Step 3 to an existing email or API automation.
The module provides you with Liquid code which, when run, carries out a range of actions using the details of the Siteglide CRM user who submitted the form and triggered the automation.
The following parameters can be used to modify behaviour:
marketing_provider
required
At the moment, as we only support Sendgrid, this should be set to sendgrid
. In future this may allow others to be selected.
action
- add
or update_if_added
or remove
required
This parameter controls essentially whether you wish the contact to be added or removed from the system, however, its behaviour is further modified by the lists
parameter.
If the lists
parameter is not included: add
will add the contact to the marketing provider; remove
will delete the contact from the e-marketing provider.
update_if_added
is similar to add
, but is designed for use-cases where you do not know if the user in question has given consent to receive marketing material. It will not create a new contact, but if a contact with that email address already exists, it will update custom fields to the latest Siteglide CRM data.
lists
Setting this parameter further modifies the behaviour of the previously discussed action
parameter.
lists
can be set to a comma-separated list of strings, where each string is an exact spelling to the name of a list in Sendgrid e.g.
The above example will add the contact to both lists.
Unlike custom-fields which are automatically synced to Sendgrid and created there, lists cannot be automatically created by the module API. They must be manually created in the Sendgrid portal first.
If the lists
parameter is set: add
will both add the contact and add them to all of the given lists. remove
will remove the contact from all given lists, but will not delete them as a contact.
If you do wish to delete the contact completely, remove the lists
parameter.
reserved_fields
The module automatically creates custom fields when you use the code to sync a contact, but Sendgrid also has "reserved fields" for storing data. The module will fill in some reserved fields automatically, like name and email address. But others will not be filled in automatically.
You can use the reserved_fields
parameter to map Siteglide data into those reserved fields (optionally). To do this, first use the parse_json tag from platformOS or equivalent to create a liquid object, where the keys are exact matches for sendgrid reserved field names, and the values can be anything- hardcoded or dynamic Liquid data. Then pass the object in as the value of the parameter.
email
In most cases, adding the email
parameter is unecessary as it will default to the value of {{form.properties.email}}
which would be available inside a Siteglide automation for example.
However, if your use case requires running the code in a situation where this is not available, you can pass in the email address as a string instead: