I want to send to each customer 10$ discount for 35$+ purchase and 20$ discount for purchase 70$+. This way they will be able to put discount code on their second purchase. If i'll create a discount in advance then I can email to a customer that discount code. That brings two issues:
Best way would be if I could generate discount code for each customer and send it with order confirmation email. How can I create discount codes unique to each customer programmatically (hopefully in template Settings -> Notifications -> Order confirmation ). Your documentation states that it's possible to make 20,000,000 discounts per store (https://help.shopify.com/en/manual/promoting-marketing/discount-codes/create-discount-codes). I'm sure 20,000,000 can't be done manually and there is a way to do it automatically.
app Auto Discount: Welcome Voucher is exactly what you are looking for. With this app, you can automatically generate discount code for customer, who create an order in your store. You can set one offer to generate discount code for customer who create an order higher then 35$ and second offer to generate discount code for customer who create an order higher then 70$. So customer will be able to use this generated voucher for his next order. In app configuration you can set more options for offers like discount value (percent, or fix, or percent from order value) and much more.