ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Commerce email template variables

August 02, 2010 9:17am

Subscribe [4]
  • #1 / Aug 02, 2010 9:17am

    Clive Portman

    83 posts

    Simply got this as the email template:

    Dear {first_name} {last_name},
    
    Thank you for your order of…
    
    Workshop name: {item_name}
    Workshop date: {option_selection1}
    Number of tickets: {quantity}
    
    Total Payment: {payment_gross}
    PayPal Transaction Fee: {payment_fee}
    Payment date {payment_date}
    Transaction ID: {txn_id}

    Unfortunately, {option_selection1}, {payment_gross} and {payment_fee} are empty. Am I missing something?

    Thanks,

  • #2 / Aug 02, 2010 6:32pm

    Brandon Jones

    5500 posts

    monkey_don, which version and build are you using? Does the stock email template work correctly?

  • #3 / Aug 03, 2010 2:14am

    Clive Portman

    83 posts

    Mmm. The stock template worked…

    Strange how {payment_gross} and {payment_fee} work in that but not mine. Is it something to do with the options?

    Version is 1.6.9.

  • #4 / Aug 03, 2010 4:14am

    John Henry Donovan

    12339 posts

    monkey_don,

    Try adding your option to the stock template. Does that work?

  • #5 / Aug 03, 2010 5:49am

    Clive Portman

    83 posts

    Tried and: {option_selection1} is empty.

    The {payment_gross} and {payment_fee} have displayed fine, though.

    Any ideas?

  • #6 / Aug 03, 2010 6:25pm

    Brandon Jones

    5500 posts

    Does this occur with other items, or just one in particular?

  • #7 / Aug 03, 2010 6:48pm

    Clive Portman

    83 posts

    It was occurring with more than one item. I say ‘was’ as I’ve changed things around so the options information is part of the item_name now.

    It makes sense as I don’t think the options would be displayed in the purchases area of the module, anyway.

    Thanks.

  • #8 / Aug 04, 2010 2:17am

    Clive Portman

    83 posts

    Okay. I thought this was sorted, but I’m still having problems with the basic variables.
    This template:

    Purchase completed!
    
    QTY {quantity} - {item_name}
    Total Payment: {payment_gross}
    PayPal Transaction Fee: {payment_fee}
    
    --------------------------
    
    Buyer ({payer_status}):
    
    {first_name} {last_name}
    {payer_business_name}
    
    Address ({address_status}):
    
    {address_name}
    {address_street}
    {address_city}, {address_state} {address_zip}
    {address_country}

    ...sends this email:

    Purchase completed!
    
    QTY 1 - Workshop 16th August [this is the product name]
    Total Payment: 
    PayPal Transaction Fee: 
    
    --------------------------
    
    Buyer (verified):
    
    [name removed]
    
    
    Address (confirmed):
    
    [address removed]

    The square brackets are my comments.

  • #9 / Aug 04, 2010 2:44am

    Clive Portman

    83 posts

    Solved! Woo-hoo!

    What wasn’t clear to me was that the variables listed next to the Email Template Form are actually PayPal variables and not EE variables.

    Checking the IPN found that {payment_fee} and {payment_gross} were empty. Why?

    PayPal’s IPN Variable Reference had the answer:

    payment_gross =
    Full USD amount of the customer’s payment, before transaction fee is subtracted. Will be empty for non-USD payments. This is a legacy field replaced by mc_gross. If this amount is negative, it signifies a refund or reversal, and either of those payment statuses can be for the full or partial amount of the original transaction.

    So, basically, it’s a deprecated variable and only works with USD. My payments were with NZD, which is why it wasn’t displaying in the email. Instead, I needed to use mc_gross.

    It might be worth pointing that out in the Docs, as they suggest something which only works for one currency and is now deprecated (and therefore isn’t that helpful).

    Thanks anyway.

  • #10 / Aug 04, 2010 2:21pm

    Sue Crocker

    26054 posts

    Thanks for posting back with additional info. I’ll mention this thread to our documentation person. (Lisa) Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases