• Resolved guinasathya

    (@guinasathya)


    Hi people!

    Is it possible to save the {{cart_recovery_link}} variable in the custom field?

    My intention is:
    I have a conditional with 2 possibilities, one creates a 10% coupon and the other a 20% coupon.
    Right in the email that will be sent to the customer I want to use the variable {{cart_recovery_link coupon='{{wc_dynamic_coupon id=”xxx”}}’}}, so that the link already loads the included coupon.

    So, I thought about saving the link in a custom field while it is still inside the conditional, so that it saves the link with the corresponding coupon, and then sends the value of that field in the email. This would allow me to not have to create 2 email templates while still inside the conditional. That way, just 1 email template would be enough.

    But I tried everything and the {{cart_recovery_link}} variable is not saved in a custom field.

    If you have any guidance, I would be very grateful.
    Guina.-

Viewing 1 replies (of 1 total)
  • Thread Starter guinasathya

    (@guinasathya)

    Updating: I managed to solve it!
    I think I understood the secret of the thing: the {{cart_recovery_link}} link is generated when sending by email (or webhook). Am I right with this?
    That’s why I couldn’t save it before it was used, because it doesn’t even exist.

    So I worked around it like this: I saved the coupon generated within the conditional in a custom user field “last_coupon”, and then in the email I used {{cart_recovery_link coupon='{{last_coupon}}’}}

    It worked perfect like that! =)

    I will mark it as resolved. Cheers!
    Guina.-

Viewing 1 replies (of 1 total)
  • The topic ‘Save {{cart_recovery_link}} in custom field’ is closed to new replies.