#philipper_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1347176075066605699
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Before the end of the subscription (in the 5th or 11th month), I'd like to send a reminder to the customer.
this can be done with a Dashboard setting: https://dashboard.stripe.com/settings/billing/automatic
Thanks soma
I haven't explained my project enough. I don't want to use the Dashboard. I want to use the API and a PHP code.
but why not let Stripe handle the emails for you?
How do I list subscriptions due to expire in less than a month?
you would call https://docs.stripe.com/api/subscriptions/list, and then filter the Subscriptions on your end. Or better, listen to theinvoice.upcomingevent
I need to personalize the message according to the progress of the customer's treatment. Automatic messages don't work for me.
๐ taking over for my colleague. Let me catch up.
I guess the invoice.upcoming event is your best option here
as my colleague suggested
OK thanks for your help.
As there is a monthly payment. I think there is one bill per month. How do I know that it is the last bill of the subscription that is scheduled?
you can retrieve the subscription or the subscription schedule and look at their end date and compare that to the invoice's period end
Yes
I currently list all subscriptions and look for the end date of the last phase.
But I was hoping for a simpler system. A system that allows to search for subscriptions that expire within a certain period (for example, within the next 30 days).
I think listening to the invoice.upcoming is a better solution
since you won't have to do everything by batches and list and filter yourself
OK thanks
I will test this solution
I'll be back to give feedback on this solution when it's up and running.
See you soon
sure