The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

How to tell if a transaction xml feed is new or a recurring subscription?

MindSculptMindSculpt Member
in Help edited February 2012
@fc_adam clarified for me via email that subscriptions send out transaction xml feeds when they renew. I'd like to be able to tell the difference between the two so I can send a reminder email that the subscription has renewed. Adam also mentioned to check for the sub_token_url on the recurring transaction, however this value is present in both the original subscription transaction and each recurring transaction feed. What's the best way to tell them apart?
  • lukeluke FoxyCart Team
    We're talking about including a counter to make this easier in the future, but for now, checking to see if the subscription next date = start date + one frequency unit, then you know that was the initial transaction that started the subscription.

    As for sending a specific email, your customers will already get an email when the transaction is completed if you're using FoxyCart's built in email receipts. You can also use placeholders and language strings to put in custom content that will only show up for subscriptions.

    In the "language" section of your FoxyCart admin, look for "html subscription links" and "html subscription instructions" under the email heading. Also, if you want custom language for when they modify a subscription or cancel one, use these:

    I hope that helps.
  • @luke Ok. So every time a subscription is processed by foxycart, an email gets sent automatically - I don't have to detect it, correct?
  • lukeluke FoxyCart Team
    Yes, it's just another transaction. Transactions from FoxyCart send receipt emails as long as your email template has a subject set.
  • @luke The 'language' section tips was helpful, however you might want to note that those dynamic URLs don't work if you've implemented SSO, like I have...

    That was one of the reasons I started this discussion; to possibly intercept a transaction vs. subscription and send the customers to specific URLs, since foxycart URLs break when SSO is involved.
  • lukeluke FoxyCart Team
    @MindSculpt, can you clarify what you mean by "they don't work"? They should work just fine with SSO unless something isn't setup correctly. Is it because the user isn't already logged in so they get redirected to your login page? If so, wouldn't it just be a matter of determining where they were trying to go originally and redirecting them accordingly?
  • @luke Right, the user probably won't be logged in when they decide to go back and update/cancel their subscription from their email, so the SSO shoots them back to the home page. I'm already using custom links in the emails I send out via the datafeed. The foxycart dynamic URLs are going to always conflict with the SSO if they're not logged in, so the dynamic links in the auto-emails won't work for SSO integrated sites.
  • lukeluke FoxyCart Team
    But that's just a matter of how you configure your SSO, isn't it? Instead of just redirecting back to the home page and forgetting what they were trying to do, why not store the SSO information in a session variable and send them to a generic login screen? From there, they login and then get redirected right back to where they expect. That seems like a nicer user flow to me. But, if you have something working, cool. I just wanted to be clear that SSO certainly does work with our links, you just have to keep track of what the user wants to do if they aren't already logged in.
Sign In or Register to comment.