Title: Send a login code sends wrong email template
Last modified: October 1, 2024

---

# Send a login code sends wrong email template

 *  Resolved [elvism](https://wordpress.org/support/users/elvism/)
 * (@elvism)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/)
 * Hello Folks, almost done with setting things up but here’s what happens when 
   I use a coupon “FREEBOOK” to reduce the payment amount to 0.00.
    1. I navigate to <domain>/shop
    2. Select the product
    3. Add to cart
    4. Go to checkout (not instant checkout)
    5. Enter the coupon
    6. Price goes down to 0
    7. I then complete the payment (w/o being asked for credit card and stuff, which
       is cool)
    8. Then I get 2 emails – `access to your purchase` and `thank you for your purchase`
 * In the first one, downloading of the file works fine. However, “access our portal”
   takes me to a 404 (page not found).
 * When I navigate to the portal manually (as I know the URL), “Send a login code”
   sends me an email that’s related to my payment details and of course does not
   work.
 * In the 2nd email, thanks for your purchase, the link does not work (also leads
   to a 404).
 * I noticed you’re having order_id and purchase_id as query params for your links.
   It could be something related to these.
 * Any help would be appreciated.
 * I tested it all with a test user (and test payment processor via Instant Checkout
   this time) and faced the exact same behavior – with and w/o using coupon code.
    -  This topic was modified 1 year, 8 months ago by [elvism](https://wordpress.org/support/users/elvism/).
      Reason: added some more details
    -  This topic was modified 1 year, 8 months ago by [elvism](https://wordpress.org/support/users/elvism/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsend-a-login-code-sends-wrong-email-template%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [elvism](https://wordpress.org/support/users/elvism/)
 * (@elvism)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18049261)
 * Tested again with a coupon code for 100% OFF and a new email/customer.
 * Code generation (for passwordless login) works for the new email/customer. However,
   the other 2 emails still have the same issues.
 * Ref:
 * In the first one, downloading of the file works fine. However, “access our portal”
   takes me to a 404 (page not found).
 * Ref to the non-working link: [https://app.surecart.com/return_redirects/purchases/cc2d3579-d102-4542-b486-d57c9c5fcdbf?customer_link_id=2b821a4a-641d-47e9-b743-5e3a94904a61](https://app.surecart.com/return_redirects/purchases/cc2d3579-d102-4542-b486-d57c9c5fcdbf?customer_link_id=2b821a4a-641d-47e9-b743-5e3a94904a61)
 * In the 2nd email, thanks for your purchase, the link does not work (also leads
   to a 404).
 * Ref to the non-working link: [https://app.surecart.com/return_redirects/orders/468ec95e-edda-4974-8fc7-d26368888117?customer_link_id=57fa1e90-019e-4211-b157-b8a1a0615f06](https://app.surecart.com/return_redirects/orders/468ec95e-edda-4974-8fc7-d26368888117?customer_link_id=57fa1e90-019e-4211-b157-b8a1a0615f06)
   and then redirects to [https://queen-inas-kennel.com/shop/surecart/redirect?customer_link_id=57fa1e90-019e-4211-b157-b8a1a0615f06&order_id=468ec95e-edda-4974-8fc7-d26368888117](https://queen-inas-kennel.com/shop/surecart/redirect?customer_link_id=57fa1e90-019e-4211-b157-b8a1a0615f06&order_id=468ec95e-edda-4974-8fc7-d26368888117)
 *  Thread Starter [elvism](https://wordpress.org/support/users/elvism/)
 * (@elvism)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18050197)
 * I managed to come up with a temporary solution which is to hardcode the URLs 
   in both email templates from your cloud service straight (app.surecart.com).
 * Email templates: “Order Confirmation” and “Product Access”
 * [[Now, that the two links are corrected/hardcoded, I can safely get to the customer portal [https://queen-inas-kennel.com/customer-dashboard](https://queen-inas-kennel.com/customer-dashboard).
 * However, the email generation logic broke again. Tried 3 different emails and
   got 3 different login codes, none of which worked. Don’t even see info for the
   POST request in the networking tab. It just refreshes the page once I click “
   enter confirmation code” and I get back to “login screen”.
 * In a nutshell, I found a workaround for 2 out of the 3 issues I initially had.
   Login link just does not work half of the time for some reason. Could you, please,
   take a look at this?
 *  Thread Starter [elvism](https://wordpress.org/support/users/elvism/)
 * (@elvism)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18052818)
 * Just submitted a support ticket.
 *  Plugin Support [Ivan C.](https://wordpress.org/support/users/ivanbsf/)
 * (@ivanbsf)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18053569)
 * Hello [@elvism](https://wordpress.org/support/users/elvism/)
 * Thank you for submitting your support ticket; we will respond to it there!
 * Best,
 *  Thread Starter [elvism](https://wordpress.org/support/users/elvism/)
 * (@elvism)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18055836)
 * For anybody who’s having this issue. Please, double-check if the URL you provided
   in the “General” tab of SC website ends with “/shop”. It must be your <domain.
   com> w/o anything at the end.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Send a login code sends wrong email template’ is closed to new replies.

 * ![](https://ps.w.org/surecart/assets/icon-256x256.gif?rev=3285224)
 * [SureCart - Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments](https://wordpress.org/plugins/surecart/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/surecart/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/surecart/)
 * [Active Topics](https://wordpress.org/support/plugin/surecart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/surecart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/surecart/reviews/)

## Tags

 * [email](https://wordpress.org/support/topic-tag/email/)

 * 5 replies
 * 2 participants
 * Last reply from: [elvism](https://wordpress.org/support/users/elvism/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/send-a-login-code-sends-wrong-email-template/#post-18055836)
 * Status: resolved