#Cocochief
1 messages · Page 1 of 1 (latest)
If the Promo code is identified with the code parameter WINBACK that will map to a single Promo code record, which can only have 1 expires_at date.
The best approach to this would be to create a unique Promo Code for each customer with a unique expires_at timestamp.
However that approach will require unique code values as well
The trouble we are having is that we can't figure out how to change the promo code paramater in the URL that we embed into the email template. We use MailChimp, where we know we can embed an email tag into the URL, so we know which customer is clicking on the link. But as far as we know, there isn't a way to embed a variable promo code.
that changes for each customer.
Would you have any other suggestions?
What is the interface the customer enters the promo code into?
We are planning to use Stripe's hosted payment/checkout page.
Something like this: https://buy.stripe.com/00g7tNdPP0QUaOI9AB?prefilled_promo_code=2MONTHWELCOME&prefilled_email=<emailAddress>
I am not aware of a way Stripe/Mailchimp integration could allow me to embed a customer-specific promo code into the email.
And you cannot programmatically generate the URL?
Oh wait, sorry NVM
This is the redirect URL
So in this case you are not able to control the code that generates the Checkout Session?
And follow this guide? https://stripe.com/docs/payments/checkout/discounts
I am not able to generate a completely customized link to embed into MailChimp......
The code snippets in that doc are another way to embed the discount when creating the Checkout Session, not as a URL parameter
To confirm. We would:
- Put something like this into the email template's CTR: `http://myserver.com/winback?email=foobar@example.
- Assuming the user's promo hasn't expired, our service can use (https://stripe.com/docs/api/checkout/sessions/object), to generate a URL and redirect user to that?
- But if the promo has expired, then our code would redirect the user to an expiration page?
Your server would create the Checkout Session and redirect the customer to the page. At that point you can check whether the promo code is still valid and handle that logic as you see fit.
You could create the Session without the promo code if it was invalid, or send them to a page informing them that the code is expired
So you think that's the best way to approach this?
I'm still a little confused about this integration path. Just so I am clear, you are creating Checkout Sessions with URL embedded query parameters to auto-fill the generated form and using Mailchimp to send them to your customers. Is that correct?
Yeah, that's what I am thinking....
I am honestly a bit confused by the whole process myself.
Basically Mailchimp is super limited in terms of putting variables into the CTA URL. So, I need a way to work around that.
I think creating the Checkout Session with the promo code as part of it is likely the best approach. One way to test this behavior I would recommend is to create a couple Customers in test mode, create promo codes for each, but set one as expired. Then create Checkout sessions for each and see how the UI handles the expired promo code when it loads the page.
Yeah, we'll give that a try.
To be perfectly clear, I'm referring to the approach in the second code snippet here:https://stripe.com/docs/payments/checkout/discounts#create-a-coupon
Where you don't require the customer to input the promo code
I see. I can do the coupon. and manually control expiration.
Looks like alternative is to create custom promo codes then I would be able to add an expiration? https://stripe.com/docs/payments/checkout/discounts#create-a-promotion-code
Also for the redirect, would you happen to know if 302 redirect is what I should be doing?
That is true, you could take that approach as well. But each promo code would need a unique code for each Customer e.g. WINBACK_123
You can see an example of the Checkout process in any of the 7 sever-side languages Stripe supports here: https://stripe.com/docs/checkout/quickstart
I am not familiar with MailChimp integrations but I wonder if you could also just embed the CheckoutSession URL in the CTA
Yeah, that would be ideal. I'll ask MailChimp. But I think their interface is pretty limited.
Lastly, would I use a 302 redirect? Would you happen to know?
which type of redirect is best?
You can see in the quickstart code we are using 303 status codes