Hi @JanBonhoeffer!
There are a couple of ways that I can think to create a unique code for each person. The place to start is this article: Different ways to create a unique random string in your Zap
In the article, @jesse explains how to use the Formatter by Zapier app to create a randomly generated number. Although it’s statistically unlikely that the same number will come up twice, if you wanted to be certain, you could perhaps take some part of the persons name (eg the first three letters) and add that to the randomly generated number. A comment on that article provides code that you can use in Code by Zapier to generate a unique ID, that would do exactly what you’re looking for, but the ID would be a long string and if you’d like to change anything in the code, that’s not something that Zapier would be able to support you with.
Once you’ve decided how to generate the code in the Zap, you can add an action that will add that ID into Airtable (or whichever app you choose).
For the Mailerlite side of things, are you using MailerLite or MailerLite classic? It sounds like you will need to add the ID as a custom variable in an email that sends as part of an automation.
I hope that helps, let us know if you have any questions!
Thank you so much for your reply.
I’m afraid my request may not have been clear enough.
We have a list of codes already. The part we are struggling with is how to get the code (which already lives in the Google Sheet - as outlined from another helpful article in this community) into an automated email using Mailerlite (reg, not classic version)
So, if we are to understand correctly, we take the first 2 steps from the article “Sending Unique Coupon Codes to your customers”, but then for Action 3 to send coupon code, we need to figure out the Mailerlite option that updates subscriber info (custom id field)? And then how to get the GoogleSheet (or Airtable) to update the code from “NO” (under USED) to say yes...is there a way to replace it with the name+email of the subscriber?
Thanks again for your reply, just trying to narrow this down properly.
Jan
Hi @JanBonhoeffer!
I don’t have a Mailerlite account to test this with at the moment, but here’s the general idea:
Trigger: Mailerlite — New Subscriber
Action: Airtable — Find Record (search within a view that contains available codes, by a “used?” field, making sure it’s empty or says no)
Action: Mailerlite — Create/Update Subscriber (update a custom field with this code)
Action: Airtable — Update Record (use the record ID from the search above, update the field that specifies whether it’s used and maybe include a separate field for “used by” to add name+email)
In Mailerlite, you’d want some sort of delay before the email gets sent, to make sure themZap has enough time to update that custom field with the personalized code.
Without being able to test it out, that’s my best guess at how you could pull this off. Hope that helps!